I am using the python interface of Stanford Named Entity Recognizer (NER). The code can be found at Pyner Code
import ner
if __name__ == "__main__":
tagger = ner.HttpNER(host='localhost', port=8080)
print tagger.get_entities("University of California is located in California, United States")
print tagger.json_entities("Alice went to the Museum of Natural History.")
The supposed outputs:
{'LOCATION': ['California', 'United States'], 'ORGANIZATION': ['University of California']}
'{"ORGANIZATION": ["Museum of Natural History"], "PERSON": ["Alice"]}'
Problem: I am getting empty sets why?
I tried the following solution-StackoverFlow but it didn't work I received the following exception:
Exception in thread "main" java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at java.net.ServerSocket.<init>(ServerSocket.java:128)
at edu.stanford.nlp.ie.NERServer.<init>(NERServer.java:71)
at edu.stanford.nlp.ie.NERServer.main(NERServer.java:331)