public class OpenNlpExtractor extends EntityExtractor
Constructor and Description |
---|
OpenNlpExtractor()
Create a new, uninitialized OpenNLP Entity Extractor.
|
OpenNlpExtractor(java.io.File modelFile)
Create an OpenNlpExtractor, using the model or models specified.
|
OpenNlpExtractor(java.lang.String model)
Create an OpenNlpExtractor, using the model or models specified.
|
Modifier and Type | Method and Description |
---|---|
void |
addModel(java.io.File modelFile)
Add the model file, or all model files within the directory.
|
void |
addModel(java.io.File modelFile,
EntityType type)
Add the model file with the specified entity type.
|
protected void |
extractEntities(java.lang.String text,
java.util.Map<java.lang.String,EntityTag> tokenMap)
Extract the entities from the text provided.
|
java.util.Map<java.lang.String,java.lang.String> |
extractEntityRawTypes(java.lang.String text)
Retrieve the entities and the raw types for this entity extractor.
|
java.lang.String |
getModel()
Get the model for this extractor.
|
void |
setModel(java.lang.String model)
Set the model for this extractor.
|
addTagFieldMapping, addTextField, augmentRecord, extract, extract, extract, extract, getDefaultTagField, isDebug, setDebug, setDefaultTagField
public OpenNlpExtractor()
public OpenNlpExtractor(java.io.File modelFile)
modelFile
- the model file, or directory of model filespublic OpenNlpExtractor(java.lang.String model)
model
- the path to the model file, or directory of model filespublic void addModel(java.io.File modelFile)
modelFile
- the model file, or directory of model filespublic void addModel(java.io.File modelFile, EntityType type)
modelFile
- the model file, or directory of model filestype
- entity type for the model fileprotected void extractEntities(java.lang.String text, java.util.Map<java.lang.String,EntityTag> tokenMap)
extractEntities
in class EntityExtractor
text
- the text to extracttokenMap
- the map to contain the tokens in.public java.util.Map<java.lang.String,java.lang.String> extractEntityRawTypes(java.lang.String text)
extractEntityRawTypes
in class EntityExtractor
text
- the text to parse for entitiespublic java.lang.String getModel()
getModel
in class EntityExtractor
public void setModel(java.lang.String model)
setModel
in class EntityExtractor
model
- the model file path