corenlp
corenlp copied to clipboard
Can you give a sample code on how to access the module?
I am beginner with NLP and would like to use the corenlp package with python.
Check out the docs.
For me it took the following steps:
- Install CoreNLP, e.g. v 3.6.0 to
/usr/local/corenlp/stanford-corenlp-full-2015-12-09
- Add the environment variables:
# CoreNLP
export CORENLP_DIR=/usr/local/corenlp/stanford-corenlp-full-2015-12-09
export CORENLP_VER=3.6.0
- restart your shell or
source
the bash file - run the example program
import corenlp.server
import corenlp.client
if __name__ == '__main__':
corenlp.server.start()
client = corenlp.client.CoreNLPClient()
doc = client.annotate(u"Hello, world!")
print doc
corenlp.server.stop()