Dustin Smith  committed 5d5648b

added NLTK example

  • Participants
  • Parent commits 25f5f7a
  • Tags v1.3.1

Comments (0)

Files changed (2)

    * Python interface to Stanford CoreNLP tools: tagging, phrase-structure parsing, dependency parsing, named entity resolution, and coreference resolution.
    * Runs an JSON-RPC server that wraps the Java server and outputs JSON.
-   * Outputs parse trees which can be used in `nltk`
+   * Outputs parse trees which can be used by [nltk](
 It requires [pexpect]( and (optionally) [unidecode]( to handle non-ASCII text.  This script includes and uses code from [jsonrpc]( and [python-progressbar](
 This is free and open source software and has benefited from the contribution and feedback of others.  Like Stanford's CoreNLP tools, it is covered under the [GNU General Public License](, which in short means that modifications to this program must maintain the same free and open source distribution policy.
-  * Justin Cheng jccf@221513ecf322dc32d6e088fb2f68751e45bac226
+  * Justin Cheng jcccf@221513ecf322dc32d6e088fb2f68751e45bac226
   * Abhaya Agarwal 8ed7640388cac8ba6d897739f5c8fe24eb87cc48
 import pprint
 result = json.loads(server.parse("Hello world!  It is so beautiful."))
+# example using nltk
+from nltk.tree import *
+tree = Tree.parse(result['sentences'][0]['parsetree'])
+print tree
+print tree.leaves()