Class OpenNLPNERecogniser
- java.lang.Object
-
- org.apache.tika.parser.ner.opennlp.OpenNLPNERecogniser
-
- All Implemented Interfaces:
NERecogniser
public class OpenNLPNERecogniser extends Object implements NERecogniser
This implementation ofNERecogniser
chains an array ofOpenNLPNameFinder
s for which NER models are available in classpath. The following models are scanned during initialization via class loader.:- See Also:
NamedEntityParser.DEFAULT_NER_IMPL
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATE_FILE
static Map<String,String>
DEFAULT_MODELS
static String
LOCATION_FILE
static String
MODELS_DIR
static String
MONEY_FILE
static String
NER_DATE_MODEL
static String
NER_LOCATION_MODEL
static String
NER_MONEY_MODEL
static String
NER_ORGANIZATION_MODEL
static String
NER_PERCENT_MODEL
static String
NER_PERSON_MODEL
static String
NER_TIME_MODEL
static String
ORGANIZATION_FILE
static String
PERCENT_FILE
static String
PERSON_FILE
static String
TIME_FILE
-
Fields inherited from interface org.apache.tika.parser.ner.NERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
-
-
Constructor Summary
Constructors Constructor Description OpenNLPNERecogniser()
Creates a default chain of Name finders using default OpenNLP recognizersOpenNLPNERecogniser(Map<String,String> models)
Creates a chain of Named Entity recognisers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getEntityTypes()
gets a set of entity types whose names are recognisable by thisboolean
isAvailable()
checks if this Named Entity recogniser is available for serviceMap<String,Set<String>>
recognise(String text)
call for name recognition action from text
-
-
-
Field Detail
-
MODELS_DIR
public static final String MODELS_DIR
-
PERSON_FILE
public static final String PERSON_FILE
- See Also:
- Constant Field Values
-
LOCATION_FILE
public static final String LOCATION_FILE
- See Also:
- Constant Field Values
-
ORGANIZATION_FILE
public static final String ORGANIZATION_FILE
- See Also:
- Constant Field Values
-
TIME_FILE
public static final String TIME_FILE
- See Also:
- Constant Field Values
-
DATE_FILE
public static final String DATE_FILE
- See Also:
- Constant Field Values
-
PERCENT_FILE
public static final String PERCENT_FILE
- See Also:
- Constant Field Values
-
MONEY_FILE
public static final String MONEY_FILE
- See Also:
- Constant Field Values
-
NER_PERSON_MODEL
public static final String NER_PERSON_MODEL
-
NER_LOCATION_MODEL
public static final String NER_LOCATION_MODEL
-
NER_ORGANIZATION_MODEL
public static final String NER_ORGANIZATION_MODEL
-
NER_TIME_MODEL
public static final String NER_TIME_MODEL
-
NER_DATE_MODEL
public static final String NER_DATE_MODEL
-
NER_PERCENT_MODEL
public static final String NER_PERCENT_MODEL
-
NER_MONEY_MODEL
public static final String NER_MONEY_MODEL
-
-
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 this recogniser is ready to recognise, false otherwise
-
getEntityTypes
public Set<String> 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
public Map<String,Set<String>> recognise(String text)
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
-
-