anatoliykmetyuk
7/6/2018 - 11:03 PM

Stanford Parser Parse Sentence

from nltk import tokenize, tree, parse, tag
from nltk.parse import stanford, corenlp

target = 'sample target'
tokens = tokenize.word_tokenize(target)
tagged = tag.pos_tag(tokens)
tagged

parser = stanford.StanfordParser()
tree = list(parser.tagged_parse(tagged))[0]
tree.pretty_print()