Package org.apache.tika.parser.ner.mitie
Class MITIENERecogniser
- java.lang.Object
-
- org.apache.tika.parser.ner.mitie.MITIENERecogniser
-
- All Implemented Interfaces:
NERecogniser
public class MITIENERecogniser extends Object implements NERecogniser
This class offers an implementation ofNERecogniser
based on trained models using state-of-the-art information extraction tools. This NER requires additional setup, due to runtime binding to MIT Information Extraction. See Tika MITIE Wiki for configuring this recogniser.- See Also:
NERecogniser
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>
ENTITY_TYPES
static String
MODEL_PROP_NAME
-
Fields inherited from interface org.apache.tika.parser.ner.NERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
-
-
Constructor Summary
Constructors Constructor Description MITIENERecogniser()
MITIENERecogniser(String modelPath)
Creates a NERecogniser by loading model from given path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getEntityTypes()
Gets set of entity types recognised by this recogniserboolean
isAvailable()
checks if this Named Entity recogniser is available for serviceMap<String,Set<String>>
recognise(String text)
recognises names of entities in the text
-
-
-
Field Detail
-
MODEL_PROP_NAME
public static final String MODEL_PROP_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MITIENERecogniser
public MITIENERecogniser()
-
MITIENERecogniser
public MITIENERecogniser(String modelPath)
Creates a NERecogniser by loading model from given path- Parameters:
modelPath
- path to NER model file
-
-
Method Detail
-
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 model was available, valid and was able to initialise the classifier. returnsfalse
when this recogniser is not available for service.
-
getEntityTypes
public Set<String> getEntityTypes()
Gets set of entity types recognised by this recogniser- Specified by:
getEntityTypes
in interfaceNERecogniser
- Returns:
- set of entity classes/types
-
-