Class GrobidNERecogniser
java.lang.Object
org.apache.tika.parser.ner.grobid.GrobidNERecogniser
- All Implemented Interfaces:
NERecogniser
-
Field Summary
Fields inherited from interface org.apache.tika.parser.ner.NERecogniser
DATE, LOCATION, MISCELLANEOUS, MONEY, ORGANIZATION, PERCENT, PERSON, TIME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.json.simple.JSONArray
convertToJSONArray
(org.json.simple.JSONObject obj, String key) Converts JSON Object to JSON Arrayorg.json.simple.JSONObject
convertToJSONObject
(String jsonString) Parses a JSON String and converts it to a JSON ObjectGets 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
-
-
Constructor Details
-
GrobidNERecogniser
public GrobidNERecogniser()
-
-
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
-
convertToJSONArray
Converts JSON Object to JSON Array- Returns:
- a JSON array
-
convertToJSONObject
Parses a JSON String and converts it to a JSON Object- Returns:
- a JSON Object
-
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
-