public class OpenNlpNer extends TrainableNamedEntityRecognizer implements ClassifyingTagger
This class wraps the OpenNLP Named Entity Recognizer which uses a maximum entropy approach.
The following models exist already for this recognizer:
| Constructor and Description |
|---|
OpenNlpNer(opennlp.tools.tokenize.Tokenizer tokenizer,
opennlp.tools.sentdetect.SentenceDetector sentenceDetector)
Create a new
OpenNlpNer. |
| Modifier and Type | Method and Description |
|---|---|
List<ClassifiedAnnotation> |
getAnnotations(String inputText) |
String |
getModelFileEnding() |
String |
getName() |
boolean |
loadModel(String configModelFilePath)
Load the models for the entity recognizer.
|
boolean |
oneModelPerConcept() |
boolean |
setsModelFileEndingAutomatically() |
boolean |
train(String trainingFilePath,
String modelFilePath) |
getModelFileEndingIfNotSetAutomatically, train, trainevaluate, evaluate, evaluate, evaluate, getTaggingFormat, setTaggingFormat, tagpublic OpenNlpNer(opennlp.tools.tokenize.Tokenizer tokenizer,
opennlp.tools.sentdetect.SentenceDetector sentenceDetector)
OpenNlpNer. The NER requires a tokenizer and a sentence detector in order to work properly.tokenizer - The tokenizer to use, not null.sentenceDetector - The sentence detector to use, not null.public boolean loadModel(String configModelFilePath)
Load the models for the entity recognizer. All files in the specified directory with the file name extension
".bin" are considered as OpenNLP TokenNameFinderModels.
loadModel in class TrainableNamedEntityRecognizerconfigModelFilePath - The path to the folder where the models lie.public List<ClassifiedAnnotation> getAnnotations(String inputText)
getAnnotations in interface ClassifyingTaggergetAnnotations in interface TaggergetAnnotations in class NamedEntityRecognizerpublic String getModelFileEnding()
getModelFileEnding in class TrainableNamedEntityRecognizerpublic boolean setsModelFileEndingAutomatically()
setsModelFileEndingAutomatically in class TrainableNamedEntityRecognizerpublic boolean oneModelPerConcept()
oneModelPerConcept in class TrainableNamedEntityRecognizerpublic boolean train(String trainingFilePath, String modelFilePath)
train in class TrainableNamedEntityRecognizerpublic String getName()
getName in class NamedEntityRecognizerCopyright © 2018. All rights reserved.