@@ -12,22 +12,27 @@ The package also contains a base class to expose a python-based annotation
12
12
provider (e.g. your favorite neural NER system) to the CoreNLP
13
13
pipeline via a lightweight service.
14
14
15
+ To use the package, first download the `official java CoreNLP release
16
+ <https://stanfordnlp.github.io/CoreNLP/#download> `_, unzip it, and define an environment
17
+ variable :code: `$CORENLP_HOME ` that points to the unzipped directory.
18
+
15
19
----
16
20
17
21
Annotation Server Usage
18
22
-----------------------
19
23
20
24
.. code-block :: python
21
25
22
- from corenlp import CoreNLPClient
26
+ import corenlp
23
27
24
28
text = " Chris wrote a simple sentence that he parsed with Stanford CoreNLP."
25
29
26
- # We assume that you've defined a variable $JAVANLP_HOME
27
- # that points to a Stanford CoreNLP checkout.
30
+ # We assume that you've downloaded the Stanford CoreNLP package from
31
+ # `https://stanfordnlp.github.io/CoreNLP/` and defined an environment
32
+ # variable $CORENLP_HOME that points to the unzipped directory.
28
33
# The code below will launch StanfordCoreNLPServer in the background
29
34
# and communicate with the server to annotate the sentence.
30
- with CoreNLPClient(annotators = " tokenize ssplit" .split()) as client:
35
+ with corenlp. CoreNLPClient(annotators = " tokenize ssplit" .split()) as client:
31
36
ann = client.annotate(text)
32
37
33
38
# You can access annotations using ann.
0 commit comments