Permalink
Browse files

m

  • Loading branch information...
1 parent 451375f commit e825b958719bdef087723f41e5ccf489647ca29c @vpekar committed Sep 14, 2012
Showing with 5 additions and 23 deletions.
  1. +3 −12 README.md
  2. +2 −11 stanford.py
View
@@ -10,7 +10,7 @@ parsed sentences:
* finding the shortest path between two nodes,
* print the parse in various formats.
-See examples after the if __name__ == "__main__" hooks.
+See examples after the if __ name __ == "__ main __" hooks.
INSTALLATION:
@@ -21,7 +21,7 @@ INSTALLATION:
USAGE:
-1. Produce an FDG-style of a parse (a table as a list of words with tags):
+ Initialize a parser:
parser = StanfordParser()
@@ -40,18 +40,9 @@ USAGE:
To print the sentence as a parse tree:
sentence.print_tree()
-
-2. Retrieve the 5 best parses with associated probabilities for the last-parsed sentence:
-
- parser = StanfordParser()
- sentence = parser.parse('This is a test')
- for candidate_tree in parser.lp.getKBestPCFGParses(5):
- print 'Prob:', math.e**candidate_tree.score()
- print 'Tree:'
- s = Sentence(parser.gsf, candidate_tree.object())
- s.print_table()
On input, the script accepts unicode or utf8 or latin1.
+
On output, the script produces unicode.
View
@@ -18,7 +18,7 @@
USAGE:
-1. Produce an FDG-style of a parse (a table as a list of words with tags):
+ Initialize a parser:
parser = StanfordParser()
@@ -38,17 +38,8 @@
sentence.print_tree()
-2. Retrieve the 5 best parses with associated probabilities for the last-parsed sentence:
-
- parser = StanfordParser()
- sentence = parser.parse('This is a test')
- for candidate_tree in parser.lp.getKBestPCFGParses(5):
- print 'Prob:', math.e**candidate_tree.score()
- print 'Tree:'
- s = Sentence(parser.gsf, candidate_tree.object())
- s.print_table()
-
On input, the script accepts unicode or utf8 or latin1.
+
On output, the script produces unicode.
"""

0 comments on commit e825b95

Please sign in to comment.