public class OpenNLPNERecogniser extends java.lang.Object implements NERecogniser
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.:
Entity Type | Path |
---|---|
"ner-person.bin" | |
"ner-location.bin" | |
"ner-organization.bin" | |
"ner-time.bin" | |
"ner-date.bin" | |
"ner-percentage.bin" | |
"ner-money.bin" |
NamedEntityParser.DEFAULT_NER_IMPL
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_FILE |
static java.util.Map<java.lang.String,java.lang.String> |
DEFAULT_MODELS |
static java.lang.String |
LOCATION_FILE |
static java.lang.String |
MODELS_DIR |
static java.lang.String |
MONEY_FILE |
static java.lang.String |
NER_DATE_MODEL |
static java.lang.String |
NER_LOCATION_MODEL |
static java.lang.String |
NER_MONEY_MODEL |
static java.lang.String |
NER_ORGANIZATION_MODEL |
static java.lang.String |
NER_PERCENT_MODEL |
static java.lang.String |
NER_PERSON_MODEL |
static java.lang.String |
NER_TIME_MODEL |
static java.lang.String |
ORGANIZATION_FILE |
static java.lang.String |
PERCENT_FILE |
static java.lang.String |
PERSON_FILE |
static java.lang.String |
TIME_FILE |
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
Constructor and Description |
---|
OpenNLPNERecogniser()
Creates a default chain of Name finders using default OpenNLP recognizers
|
OpenNLPNERecogniser(java.util.Map<java.lang.String,java.lang.String> models)
Creates a chain of Named Entity recognisers
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getEntityTypes()
gets a set of entity types whose names are recognisable by this
|
boolean |
isAvailable()
checks if this Named Entity recogniser is available for service
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
recognise(java.lang.String text)
call for name recognition action from text
|
public static final java.lang.String MODELS_DIR
public static final java.lang.String PERSON_FILE
public static final java.lang.String LOCATION_FILE
public static final java.lang.String ORGANIZATION_FILE
public static final java.lang.String TIME_FILE
public static final java.lang.String DATE_FILE
public static final java.lang.String PERCENT_FILE
public static final java.lang.String MONEY_FILE
public static final java.lang.String NER_PERSON_MODEL
public static final java.lang.String NER_LOCATION_MODEL
public static final java.lang.String NER_ORGANIZATION_MODEL
public static final java.lang.String NER_TIME_MODEL
public static final java.lang.String NER_DATE_MODEL
public static final java.lang.String NER_PERCENT_MODEL
public static final java.lang.String NER_MONEY_MODEL
public static final java.util.Map<java.lang.String,java.lang.String> DEFAULT_MODELS
public OpenNLPNERecogniser()
public OpenNLPNERecogniser(java.util.Map<java.lang.String,java.lang.String> models)
models
- map of entityType -> model path
NOTE: the model path should be known to class loader.public boolean isAvailable()
NERecogniser
isAvailable
in interface NERecogniser
public java.util.Set<java.lang.String> getEntityTypes()
NERecogniser
getEntityTypes
in interface NERecogniser
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> recognise(java.lang.String text)
NERecogniser
recognise
in interface NERecogniser
text
- text with possibly contains names"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"