-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text_annotation = self.pipeline.createBasicTextAnnotation("", "", text) AttributeError: 'NoneType' object has no attribute 'createBasicTextAnnotation' #86
Comments
Seems like you're missing the model files. Did you run |
@danyaljj I have downloaded it but I still get the same error:
|
Any idea what could be fixed?
|
@GHLgh any thoughts on this? |
@danyaljj @monajalal The actual error message was omitted in the code and on my side, the error message is the following:
The JDK 9 Release remove the sub-directory "jre" and I believe that pyjnius still searching files in "jre" directory. You should check if this is the case here. A workaround is to create a symbolic link (to pretend there is "jre" directory):
After using the workaround, another issue came out:
It seems like the Python string doesn't get converted to Java string properly, as suggested in the issue, this can be fixed by converting the string explicitly before passing it to APIs on Java side: # In local_pipeline.py
# import Java String class along with other imported autoclasses
self.JString = autoclass('java.lang.String')
# Convert the string into Java String before calling APIs on Java side, example:
self.pipeline.addView(text_annotation, self.JString(view.strip()))
# Previous implementation: self.pipeline.addView(text_annotation,view.strip()) After that, the example can be run properly: python -i test.py
...
>>> print(ner_view)
NER_CONLL view: (PER Hillary Clinton) (ORG NVCaucus) |
@monajalal does this resolve your problem? |
Thanks for looking into this. At the moment, I don't have enough permission and our site admin will look into this. I will notify if it will help us or what further bugs we might get. |
that didn't work out so I opted out to remote server:
btw why in here @huffingtonpost is not considered as an entity? |
Hi, check the kivy/pyjnius#300 and the newest |
What is the minimum working example of a code that I feed in a string and gives me the named entities?
For above code, I get the following error:
My server is running on 02:13:57 INFO LabeledChuLiuEdmondsDecoder:72 - Loading cached PoS-to-dep dictionary from deprels.dict
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [1.4 sec].
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [0.7 sec].
02:14:01 INFO MainServer:67 - Done with loading the pipeline . . .
02:14:01 INFO MainServer:227 - ##### Used Memory[MB]:1532
02:14:01 INFO MainServer:230 - / Free Memory[MB]:1027
02:14:01 INFO MainServer:233 - / Total Memory[MB]:2560
02:14:01 INFO MainServer:236 - / Max Memory[MB]:31858
02:14:01 INFO log:186 - Logging initialized @120702ms
02:14:01 INFO EmbeddedJettyServer:126 - == Spark has ignited ...
02:14:01 INFO EmbeddedJettyServer:127 - >> Listening on 0.0.0.0:8080
02:14:01 INFO Server:345 - jetty-9.3.6.v20151106
02:14:01 INFO ServerConnector:270 - Started ServerConnector@67e0a155{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
02:14:01 INFO Server:397 - Started @120785ms
The text was updated successfully, but these errors were encountered: