I was testing the StanfordNERTagger using the NLTK wrapper and this warning appeared:
DeprecationWarning: The StanfordTokenizer will be deprecated in version 3.2.5. Please use nltk.tag.corenlp.CoreNLPPOSTagger or nltk.tag.corenlp.CoreNLPNERTagger instead. super(StanfordNERTagger, self).__init__(*args, **kwargs)
My code looks like this:
from nltk import word_tokenize, pos_tag, ne_chunk from nltk.tag import StanfordNERTagger sentence = "Today George went to school and met his friend Peter." # stanford's NER tagger 3 entity classification st = StanfordNERTagger('/home/hercules/Desktop/PhD/Tools/stanford-ner- 2017-06-09/classifiers/english.all.3class.distsim.crf.ser.gz', '/home/hercules/Desktop/PhD/Tools/stanford-ner-2017-06-09/stanford- ner.jar', encoding='utf-8') tokenized_text = word_tokenize(sentence) classified_text = st.tag(tokenized_text) print("Stanford NER tagger:") print(classified_text)
I tried to use CoreNLPNERTagger but I could not find any examples or documentation. I only found this link: where it gives something like an example in the comments of the class CoreNLPNERTagger(CoreNLPTagger) (I found it by searching the keyword "CoreNLPNERTagge")
I tried to follow that example with no use. I think I should start (if that is the correct term) the coreNLP server first but if is that the case I don't know how.
If anyone got any idea or advice I would be grateful.