|
3 | 3 | This is a Python wrapper for Stanford University's NLP group's Java-based [CoreNLP tools](http://nlp.stanford.edu/software/corenlp.shtml). It can either be imported as a module or run as a JSON-RPC server. Because it uses many large trained models (requiring 3GB RAM on 64-bit machines and usually a few minutes loading time), most applications will probably want to run it as a server.
|
4 | 4 |
|
5 | 5 |
|
6 |
| - * Python interface to Stanford CoreNLP tools: tagging, phrase-structure parsing, dependency parsing, named entity resolution, and coreference resolution. |
| 6 | + * Python interface to Stanford CoreNLP tools: tagging, phrase-structure parsing, dependency parsing, [named-entity resolution](http://en.wikipedia.org/wiki/Named-entity_recognition), and [coreference resolution](http://en.wikipedia.org/wiki/Coreference). |
7 | 7 | * Runs an JSON-RPC server that wraps the Java server and outputs JSON.
|
8 | 8 | * Outputs parse trees which can be used by [nltk](http://nltk.googlecode.com/svn/trunk/doc/howto/tree.html).
|
9 | 9 |
|
@@ -42,7 +42,7 @@ Assuming you are running on port 8080, the code in `client.py` shows an example
|
42 | 42 | result = loads(server.parse("Hello world. It is so beautiful"))
|
43 | 43 | print "Result", result
|
44 | 44 |
|
45 |
| -That returns a dictionary containing the keys `sentences` and (when applicable) `corefs`. The key `sentences` contains a list of dictionaries for each sentence, which contain `parsetree`, `text`, `tuples` containing the dependencies, and `words`, containing information about parts of speech, NER, etc: |
| 45 | +That returns a dictionary containing the keys `sentences` and `coref`. The key `sentences` contains a list of dictionaries for each sentence, which contain `parsetree`, `text`, `tuples` containing the dependencies, and `words`, containing information about parts of speech, recognized named-entities, etc: |
46 | 46 |
|
47 | 47 | {u'sentences': [{u'parsetree': u'(ROOT (S (VP (NP (INTJ (UH Hello)) (NP (NN world)))) (. !)))',
|
48 | 48 | u'text': u'Hello world!',
|
@@ -104,13 +104,13 @@ That returns a dictionary containing the keys `sentences` and (when applicable)
|
104 | 104 | u'PartOfSpeech': u'.'}]]}],
|
105 | 105 | u'coref': [[[[u'It', 1, 0, 0, 1], [u'Hello world', 0, 1, 0, 2]]]]}
|
106 | 106 |
|
107 |
| -To use it in a regular script or to edit/debug it (because errors via RPC are opaque), load the module instead: |
| 107 | +To use it in a regular script (useful for debugging), load the module instead: |
108 | 108 |
|
109 | 109 | from corenlp import *
|
110 | 110 | corenlp = StanfordCoreNLP() # wait a few minutes...
|
111 | 111 | corenlp.parse("Parse this sentence.")
|
112 | 112 |
|
113 |
| -The server, `StanfordCoreNLP()`, takes an optional argument `corenlp_path` which specifies the relative path to the jar files. The default value is `StanfordCoreNLP(corenlp_path="./stanford-corenlp-full-2014-08-27/")`. |
| 113 | +The server, `StanfordCoreNLP()`, takes an optional argument `corenlp_path` which specifies the path to the jar files. The default value is `StanfordCoreNLP(corenlp_path="./stanford-corenlp-full-2014-08-27/")`. |
114 | 114 |
|
115 | 115 | ## Coreference Resolution
|
116 | 116 |
|
@@ -158,4 +158,4 @@ I gratefully welcome bug fixes and new features. If you have forked this reposi
|
158 | 158 |
|
159 | 159 | ## Related Projects
|
160 | 160 |
|
161 |
| -Maintainers of the Core NLP library at Stanford keep an [updated list of wrappers and extensions](http://nlp.stanford.edu/software/corenlp.shtml#Extensions). |
| 161 | +Maintainers of the Core NLP library at Stanford keep an [updated list of wrappers and extensions](http://nlp.stanford.edu/software/corenlp.shtml#Extensions). See Brendan O'Connor's [https://github.com/brendano/stanford_corenlp_pywrapper] for a different socket-based approach. |
0 commit comments