Package org.apache.tika.parser.ner.nltk
Class NLTKNERecogniser
java.lang.Object
org.apache.tika.parser.ner.nltk.NLTKNERecogniser
- All Implemented Interfaces:
NERecogniser
This class offers an implementation of
NERecogniser
based on
ne_chunk() module of NLTK. This NER requires additional setup,
due to Http requests to an endpoint server that runs NLTK.
See -
Field Summary
Modifier and TypeFieldDescriptionsome common entities identified by NLTKFields inherited from interface org.apache.tika.parser.ner.NERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets set of entity types recognised by this recogniserboolean
checks if this Named Entity recogniser is available for servicerecognises names of entities in the text
-
Field Details
-
ENTITY_TYPES
some common entities identified by NLTK
-
-
Constructor Details
-
NLTKNERecogniser
public NLTKNERecogniser()
-
-
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 server endpoint is available. returnsfalse
if server endpoint is not avaliable for service.
-
getEntityTypes
Gets set of entity types recognised by this recogniser- Specified by:
getEntityTypes
in interfaceNERecogniser
- Returns:
- set of entity classes/types
-
recognise
recognises names of entities in the text- Specified by:
recognise
in interfaceNERecogniser
- Parameters:
text
- text which possibly contains names- Returns:
- map of entity type -> set of names
-