Created
August 13, 2014 22:55
-
-
Save bogsio/dcae9bf341045ee206b1 to your computer and use it in GitHub Desktop.
parse demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viterbi_parser = PCFGViterbiParser.train(open('corpus.txt', 'r'), root='ROOT') | |
t = viterbi_parser.parse( | |
nltk.word_tokenize('Numerous passing references to the phrase have occurred in movies')) | |
print t | |
t.draw() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment