UKPLab / tac2015-event-detection

Files for Event Nugget Detection systems submitted to TAC 2015 shared task on Event Nugget Detection
GNU General Public License v3.0
19 stars 13 forks source link

Socket Server? #1

Open cag472 opened 6 years ago

cag472 commented 6 years ago

Thanks for making this available. I am trying to run it according to the directions in the README (even tried using the 2-year-old version of CoreNLP), but I keep getting stuck on the SocketServer. The error is: "Error: Could not find or load main class corenlp.SocketServer".

I see that SocketServer is defined deep in the libs directory, but I don't know enough about Java to know what to do with that. Is it that I'm using the wrong jars from CoreNLP? Or is there an extra step missing from the README?

Thanks in advance!!

nreimers commented 6 years ago

Hi, have you checked the CoreNLP Server FAQ page and followed the instructions there? https://stanfordnlp.github.io/CoreNLP/corenlp-server.html

cag472 commented 6 years ago

Yes I did; I tried starting the CoreNLP Server, but that didn't resolve this error. Could you clarify the necessary steps (after those in the README) to be able to run RunModel.py? (For context, I have 10 years of experience in Python/C++/Linux, but am not familiar with Java).

If I can get this running, I'd be happy to contribute to the project with a pull request to update the README.

nreimers commented 6 years ago

Is the server running as described here? https://stanfordnlp.github.io/CoreNLP/corenlp-server.html

And can you access the CoreNLP web interface at http://localhost:9000/ ?

When I download corenlp, unzip it and execute the following command in the unzipped folder:

java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

The server starts as expected.

cag472 commented 6 years ago

Yes, I agree, I can run CoreNLP fine just as you say. I open the localhost link, type in a sentence, and it all works as expected.

The issue is then I come back to this event detection repo in a separate terminal. I follow the instructions about moving the jars, etc. Then I type "python RunModel.py", and I get the following crash:

INFO:CoreNLP_PyWrapper:mode given as 'pos' so setting annotators: tokenize, ssplit, pos, lemma INFO:CoreNLP_PyWrapper:Starting java subprocess, and waiting for signal it's ready, with command: exec java -Xmx4g -XX:ParallelGCThreads=1 -cp '/Users/alexgeorge/Code/BOSSS/NLP/events/libs/stanford_corenlp_pywrapper/lib/*:/Users/alexgeorge/Code/BOSSS/NLP/events/corenlp/' corenlp.SocketServer --outpipe /tmp/corenlp_pywrap_pipe_pypid=93600_time=1516223725.09 --configdict '{"annotators": "tokenize, ssplit, pos, lemma"}' Error: Could not find or load main class corenlp.SocketServer

KaiqiJinWow commented 5 years ago

Yes, I agree, I can run CoreNLP fine just as you say. I open the localhost link, type in a sentence, and it all works as expected.

The issue is then I come back to this event detection repo in a separate terminal. I follow the instructions about moving the jars, etc. Then I type "python RunModel.py", and I get the following crash:

INFO:CoreNLP_PyWrapper:mode given as 'pos' so setting annotators: tokenize, ssplit, pos, lemma INFO:CoreNLP_PyWrapper:Starting java subprocess, and waiting for signal it's ready, with command: exec java -Xmx4g -XX:ParallelGCThreads=1 -cp '/Users/alexgeorge/Code/BOSSS/NLP/events/libs/stanford_corenlp_pywrapper/lib/*:/Users/alexgeorge/Code/BOSSS/NLP/events/corenlp/' corenlp.SocketServer --outpipe /tmp/corenlp_pywrap_pipe_pypid=93600_time=1516223725.09 --configdict '{"annotators": "tokenize, ssplit, pos, lemma"}' Error: Could not find or load main class corenlp.SocketServer

Same problem! Did you solve it?

nreimers commented 5 years ago

The code is quite out-dated in terms of the neural network architecture. I would recommend to use a more recent network architecture.

I made some state-of-the-art architecture available here: https://github.com/UKPLab/emnlp2017-bilstm-cnn-crf https://github.com/UKPLab/elmo-bilstm-cnn-crf

I also used them for event detection, outperforming the code in this repository.

The above linked codes work without CoreNLP, the setup should be much easier and you get better performances at the end.