Class OpenNLPNERecogniser
java.lang.Object
org.apache.tika.parser.ner.opennlp.OpenNLPNERecogniser
- All Implemented Interfaces:
NERecogniser
This implementation of
NERecogniser
chains an array of
OpenNLPNameFinder
s for which NER models are
available in classpath.
The following models are scanned during initialization via class loader.:
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface org.apache.tika.parser.ner.NERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
-
Constructor Summary
ConstructorDescriptionCreates a default chain of Name finders using default OpenNLP recognizersOpenNLPNERecogniser
(Map<String, String> models) Creates a chain of Named Entity recognisers -
Method Summary
Modifier and TypeMethodDescriptiongets a set of entity types whose names are recognisable by thisboolean
checks if this Named Entity recogniser is available for servicecall for name recognition action from text
-
Field Details
-
MODELS_DIR
-
PERSON_FILE
- See Also:
-
LOCATION_FILE
- See Also:
-
ORGANIZATION_FILE
- See Also:
-
TIME_FILE
- See Also:
-
DATE_FILE
- See Also:
-
PERCENT_FILE
- See Also:
-
MONEY_FILE
- See Also:
-
NER_PERSON_MODEL
-
NER_LOCATION_MODEL
-
NER_ORGANIZATION_MODEL
-
NER_TIME_MODEL
-
NER_DATE_MODEL
-
NER_PERCENT_MODEL
-
NER_MONEY_MODEL
-
DEFAULT_MODELS
-
-
Constructor Details
-
OpenNLPNERecogniser
public OpenNLPNERecogniser()Creates a default chain of Name finders using default OpenNLP recognizers -
OpenNLPNERecogniser
Creates a chain of Named Entity recognisers- Parameters:
models
- map of entityType -> model path NOTE: the model path should be known to class loader.
-
-
Method Details
-
isAvailable
public boolean isAvailable()Description copied from interface:NERecogniser
checks if this Named Entity recogniser is available for service- Specified by:
isAvailable
in interfaceNERecogniser
- Returns:
- true if this recogniser is ready to recognise, false otherwise
-
getEntityTypes
Description copied from interface:NERecogniser
gets a set of entity types whose names are recognisable by this- Specified by:
getEntityTypes
in interfaceNERecogniser
- Returns:
- set of entity types/classes
-
recognise
Description copied from interface:NERecogniser
call for name recognition action from text- Specified by:
recognise
in interfaceNERecogniser
- Parameters:
text
- text with possibly contains names- Returns:
- map of entityType -> set of names
-