corenlp icon indicating copy to clipboard operation
corenlp copied to clipboard

Can you give a sample code on how to access the module?

Open bhaumik93 opened this issue 10 years ago • 1 comments

I am beginner with NLP and would like to use the corenlp package with python.

bhaumik93 avatar Feb 17 '15 19:02 bhaumik93

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()

FraBle avatar Feb 01 '16 05:02 FraBle