class documentation

>>> from nltk.parse.stanford import StanfordNeuralDependencyParser
>>> dep_parser=StanfordNeuralDependencyParser(java_options='-mx4g')
>>> [parse.tree() for parse in dep_parser.raw_parse("The quick brown fox jumps over the lazy dog.")] # doctest: +NORMALIZE_WHITESPACE
[Tree('jumps', [Tree('fox', ['The', 'quick', 'brown']), Tree('dog', ['over', 'the', 'lazy']), '.'])]
>>> [list(parse.triples()) for parse in dep_parser.raw_parse("The quick brown fox jumps over the lazy dog.")] # doctest: +NORMALIZE_WHITESPACE
[[((u'jumps', u'VBZ'), u'nsubj', (u'fox', u'NN')), ((u'fox', u'NN'), u'det',
(u'The', u'DT')), ((u'fox', u'NN'), u'amod', (u'quick', u'JJ')), ((u'fox', u'NN'),
u'amod', (u'brown', u'JJ')), ((u'jumps', u'VBZ'), u'nmod', (u'dog', u'NN')),
((u'dog', u'NN'), u'case', (u'over', u'IN')), ((u'dog', u'NN'), u'det',
(u'the', u'DT')), ((u'dog', u'NN'), u'amod', (u'lazy', u'JJ')), ((u'jumps', u'VBZ'),
u'punct', (u'.', u'.'))]]
>>> sum([[parse.tree() for parse in dep_graphs] for dep_graphs in dep_parser.raw_parse_sents((
...     "The quick brown fox jumps over the lazy dog.",
...     "The quick grey wolf jumps over the lazy fox."
... ))], []) # doctest: +NORMALIZE_WHITESPACE
[Tree('jumps', [Tree('fox', ['The', 'quick', 'brown']), Tree('dog', ['over',
'the', 'lazy']), '.']), Tree('jumps', [Tree('wolf', ['The', 'quick', 'grey']),
Tree('fox', ['over', 'the', 'lazy']), '.'])]
>>> sum([[parse.tree() for parse in dep_graphs] for dep_graphs in dep_parser.parse_sents((
...     "I 'm a dog".split(),
...     "This is my friends ' cat ( the tabby )".split(),
... ))], []) # doctest: +NORMALIZE_WHITESPACE
[Tree('dog', ['I', "'m", 'a']), Tree('cat', ['This', 'is', Tree('friends',
['my', "'"]), Tree('tabby', ['-LRB-', 'the', '-RRB-'])])]

Method __init__ Undocumented
Method tagged_parse_sents Currently unimplemented because the neural dependency parser (and the StanfordCoreNLP pipeline class) doesn't support passing in pre- tagged tokens.
Method _make_tree Undocumented
Constant _DOUBLE_SPACED_OUTPUT Undocumented
Constant _JAR Undocumented
Constant _MAIN_CLASS Undocumented
Constant _MODEL_JAR_PATTERN Undocumented
Constant _OUTPUT_FORMAT Undocumented
Constant _USE_STDIN Undocumented

Inherited from GenericStanfordParser:

Method parse_sents Use StanfordParser to parse multiple sentences. Takes multiple sentences as a list where each sentence is a list of words. Each sentence will be automatically tagged with this StanfordParser instance's tagger...
Method raw_parse Use StanfordParser to parse a sentence. Takes a sentence as a string; before parsing, it will be automatically tokenized and tagged by the Stanford Parser.
Method raw_parse_sents Use StanfordParser to parse multiple sentences. Takes multiple sentences as a list of strings. Each sentence will be automatically tokenized and tagged by the Stanford Parser.
Method tagged_parse Use StanfordParser to parse a sentence. Takes a sentence as a list of (word, tag) tuples; the sentence must have already been tokenized and tagged.
Instance Variable corenlp_options Undocumented
Instance Variable java_options Undocumented
Instance Variable model_path Undocumented
Method _execute Undocumented
Method _parse_trees_output Undocumented
Instance Variable _classpath Undocumented
Instance Variable _encoding Undocumented

Inherited from ParserI (via GenericStanfordParser):

Method grammar No summary
Method parse When possible this list is sorted from most likely to least likely.
Method parse_all No summary
Method parse_one No summary
def __init__(self, *args, **kwargs): (source)
def tagged_parse_sents(self, sentences, verbose=False): (source)

Currently unimplemented because the neural dependency parser (and the StanfordCoreNLP pipeline class) doesn't support passing in pre- tagged tokens.

def _make_tree(self, result): (source)

Undocumented

_DOUBLE_SPACED_OUTPUT: bool = (source)
_JAR: str = (source)

Undocumented

Value
'stanford-corenlp-(\\d+)(\\.(\\d+))+\\.jar'
_MAIN_CLASS: str = (source)

Undocumented

Value
'edu.stanford.nlp.pipeline.StanfordCoreNLP'
_MODEL_JAR_PATTERN: str = (source)

Undocumented

Value
'stanford-corenlp-(\\d+)(\\.(\\d+))+-models\\.jar'
_OUTPUT_FORMAT: str = (source)

Undocumented

Value
'conll'
_USE_STDIN: bool = (source)

Undocumented

Value
True