public class OpenNLPNameFinder extends java.lang.Object implements NERecogniser
NERecogniser
that finds names in text using Open NLP Model.
This implementation works with only one entity type. For chain this name finder instances,
see OpenNLPNERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
Constructor and Description |
---|
OpenNLPNameFinder(java.lang.String nameType,
java.lang.String nerModelPath)
Creates OpenNLP name finder
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
findNames(java.lang.String[] tokens)
finds names from given array of tokens
|
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
|
static java.lang.String[] |
tokenize(java.lang.String text) |
public OpenNLPNameFinder(java.lang.String nameType, java.lang.String nerModelPath)
nameType
- the entity type recognised by the given NER modelnerModelPath
- path to ner modelpublic boolean isAvailable()
NERecogniser
isAvailable
in interface NERecogniser
public java.util.Set<java.lang.String> getEntityTypes()
NERecogniser
getEntityTypes
in interface NERecogniser
public static java.lang.String[] tokenize(java.lang.String text)
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 namespublic java.util.Map<java.lang.String,java.util.Set<java.lang.String>> findNames(java.lang.String[] tokens)
tokens
- the tokens array"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"