In this article we will be discussing about Standford NLP Named Entity Recognition(NER) in a java project using Maven and Eclipse. The example shown here will be using different annotators such as tokenize, ssplit, pos, lemma, ner to create StanfordCoreNLP pipelines and run NamedEntityTagAnnotation on the input text for named entity recognition using standford NLP.
Annotations are internal data structures of Standford NLP that holds results of annotators whereas Annotators are like functions, except that they operate over Annotations instead of Objects.They do things like tokenize, parse, or NER tag sentences. Annotators and Annotations are integrated by AnnotationPipelines, which create sequences of generic Annotators.There are many annotators provided by Standford. For complete list visit - Standford CoreNLP Annotators
StanfordCoreNLP is initiliazed using a set of properties.These properties contain different annotators such as tokenize, ssplit, pos, lemma, ner. Following is an example.
It is also possible to give other properties to CoreNLP. Following is an example.
Once the pipeline is initialized, we basically run different annotators provided by Standford on any piece of text to extract corresponding information. Following is an example.
After these annotators are executed on the text, we basically interpret the information. All these informations are available in the annotations provided by Standford. Following is an example to interpret different sentences of a text after applying SentenceAnnotation.
After the sentences are extracted, we first tokenise the sentence and then extract named entities from the tokens.Following is an example.
For a sample text such as Charlie is working as Software Engineer in CenturyLink India Pvt. Ltd., Bangalore from October, 2014 to till date, following is the output.
I hope this article served you that you were looking for. If you have anything that you want to add or share then please share it below in the comment section.
5. Open Nlp Pos Tagger Example
Contact us: email@example.com