Closed bhavikapanara closed 2 years ago
It seems very likely that you don't have java in your path. However, this is also a very old version of this software. Please use stanfordnlp/stanza instead.
Thanks, @AngledLuffa for your quick reply.
This is working fine when I run the file from a command prompt that is for example: python3 test_corenlp.py
It simply indicates that I have added java in my path.
It does not work with gunicorn service. However, can you please describe which path we need to set. Maybe I forgot to add something.
Yes, this is a very old model but I am working with my old project where entire work is based on this model. And at the current scenario, I am not able to change the entire procedure to rollback.
So, compulsory I need to work with this model only.
I have also try to use stanfordnlp/stanza library but the annotation of the NER is different than the previous model. For example:
text = "Albert Einstein was a German-born theoretical physicist."
the old model (NER) : {'Albert Einstein' : PERSON, 'German-born' : NATIONALITY, 'theoretical' : TITLE, 'physicist': TITLE}
stanfordnlp/stanza (NER) : {'Albert Einstein' : PERSON, 'German': NORP}
The NER results are different. I am looking for the NER annotation as the old model.
Can you please help me to resolve my problem.
Thanks a lot
stanza also has an interface to corenlp, which is where the "old model" NER comes from. In fact, it's exactly the same as this project, but with newer bugfixes and more features. If you find that using this project fits your needs better: https://www.youtube.com/watch?v=EPNI4D2HyX4
As for using java in gunicorn, I don't believe anyone here has any experience with that. The FileNotFoundError suggests that it is looking for java from within python. I don't know why it would do that. If you included an entire stack trace, that might tell us a bit more. However, there is almost zero chance any of us would make any functional changes to this library when stanza already exists.
If you use the same version of corenlp with this project and stanza's interface to corenlp, the results should be the same, fwiw.
Your system has not installed java. "sudo apt-get install default-jre" will solve this problem
You need to load the java module module load java
Hi, There
The above code works well when I run it on a local PC. But, this throw below error when I run it on the server using gunicorn and nginx.
gunicorn[1255]: FileNotFoundError: [Errno 2] No such file or directory: 'java': 'java'
Please someone help me to solve this error.
Thanks, Bhavika