class documentation

Interface to the Stanford Parser

Method __init__ Undocumented
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.
Method tagged_parse_sents Use StanfordParser to parse multiple sentences. Takes multiple sentences where each sentence is a list of (word, tag) tuples. The sentences 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
Constant _DOUBLE_SPACED_OUTPUT Undocumented
Constant _JAR Undocumented
Constant _MAIN_CLASS Undocumented
Constant _MODEL_JAR_PATTERN Undocumented
Constant _USE_STDIN Undocumented
Instance Variable _classpath Undocumented
Instance Variable _encoding Undocumented

Inherited from ParserI:

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, path_to_jar=None, path_to_models_jar=None, model_path='edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz', encoding='utf8', verbose=False, java_options='-mx4g', corenlp_options=''): (source)
def parse_sents(self, sentences, verbose=False): (source)

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. If whitespaces exists inside a token, then the token will be treated as separate tokens.

Parameters
sentences:list(list(str))Input sentences to parse
verboseUndocumented
Returns
iter(iter(Tree))Undocumented
def raw_parse(self, sentence, verbose=False): (source)

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.

Parameters
sentence:strInput sentence to parse
verboseUndocumented
Returns
iter(Tree)Undocumented
def raw_parse_sents(self, sentences, verbose=False): (source)

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.

Parameters
sentences:list(str)Input sentences to parse
verboseUndocumented
Returns
iter(iter(Tree))Undocumented
def tagged_parse(self, sentence, verbose=False): (source)

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.

Parameters
sentence:list(tuple(str, str))Input sentence to parse
verboseUndocumented
Returns
iter(Tree)Undocumented
def tagged_parse_sents(self, sentences, verbose=False): (source)

Use StanfordParser to parse multiple sentences. Takes multiple sentences where each sentence is a list of (word, tag) tuples. The sentences must have already been tokenized and tagged.

Parameters
sentences:list(list(tuple(str, str)))Input sentences to parse
verboseUndocumented
Returns
iter(iter(Tree))Undocumented
corenlp_options = (source)

Undocumented

java_options = (source)

Undocumented

model_path = (source)

Undocumented

def _execute(self, cmd, input_, verbose=False): (source)

Undocumented

def _parse_trees_output(self, output_): (source)

Undocumented

_DOUBLE_SPACED_OUTPUT: bool = (source)

Undocumented

Value
False
_JAR: str = (source)

Undocumented

Value
'stanford-parser\\.jar'
_MAIN_CLASS: str = (source)

Undocumented

Value
'edu.stanford.nlp.parser.lexparser.LexicalizedParser'
_MODEL_JAR_PATTERN: str = (source)

Undocumented

Value
'stanford-parser-(\\d+)(\\.(\\d+))+-models\\.jar'
_USE_STDIN: bool = (source)

Undocumented

Value
False
_classpath = (source)

Undocumented

_encoding = (source)

Undocumented