Lynten / stanford-corenlp

Python wrapper for Stanford CoreNLP.
MIT License
920 stars 200 forks source link

Can't init nlp server #37

Open orenpapers opened 6 years ago

orenpapers commented 6 years ago

Following this thread: https://github.com/Lynten/stanford-corenlp/issues/28 I'm trying to init a server:

java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
[main] INFO CoreNLP - --- StanfordCoreNLPServer#main() called ---
[main] INFO CoreNLP - setting default constituency parser
[main] INFO CoreNLP - warning: cannot find edu/stanford/nlp/models/srparser/englishSR.ser.gz
[main] INFO CoreNLP - using: edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz instead
[main] INFO CoreNLP - to use shift reduce parser download English models jar from:
[main] INFO CoreNLP - http://stanfordnlp.github.io/CoreNLP/download.html
[main] INFO CoreNLP -     Threads: 8
[main] INFO CoreNLP - Starting server...
[main] INFO CoreNLP - StanfordCoreNLPServer listening at /0:0:0:0:0:0:0:0:9000

Then I tried to execute the command nlp = StanfordCoreNLP('http://localhost', port=9000) But nothing happened, even for simple python command such as


a = 2
print(a)

It worth noting that when I open is the browser I have an access to the server, but I want to communicate with it from python