Package opennlp.dl.namefinder
Class NameFinderDL
java.lang.Object
opennlp.dl.AbstractDL
opennlp.dl.namefinder.NameFinderDL
- All Implemented Interfaces:
TokenNameFinder
An implementation of
TokenNameFinder that uses ONNX models.- See Also:
-
Field Summary
FieldsFields inherited from class opennlp.dl.AbstractDL
ATTENTION_MASK, INPUT_IDS, TOKEN_TYPE_IDS -
Constructor Summary
ConstructorsConstructorDescriptionNameFinderDL(File model, File vocabulary, Map<Integer, String> ids2Labels, InferenceOptions inferenceOptions, SentenceDetector sentenceDetector) Instantiates aname finderusing ONNX models.NameFinderDL(File model, File vocabulary, Map<Integer, String> ids2Labels, SentenceDetector sentenceDetector) Instantiates aname finderusing ONNX models. -
Method Summary
Methods inherited from class opennlp.dl.AbstractDL
loadVocab
-
Field Details
-
I_PER
- See Also:
-
B_PER
- See Also:
-
SEPARATOR
- See Also:
-
-
Constructor Details
-
NameFinderDL
public NameFinderDL(File model, File vocabulary, Map<Integer, String> ids2Labels, SentenceDetector sentenceDetector) throws IOException, ai.onnxruntime.OrtExceptionInstantiates aname finderusing ONNX models.- Parameters:
model- The ONNX model file.vocabulary- The model file's vocabulary file.ids2Labels- The mapping of ids to labels.sentenceDetector- TheSentenceDetectorto be used.- Throws:
ai.onnxruntime.OrtException- Thrown if themodelcannot be loaded.IOException- Thrown if errors occurred loading themodelorvocabulary.
-
NameFinderDL
public NameFinderDL(File model, File vocabulary, Map<Integer, String> ids2Labels, InferenceOptions inferenceOptions, SentenceDetector sentenceDetector) throws IOException, ai.onnxruntime.OrtExceptionInstantiates aname finderusing ONNX models.- Parameters:
model- The ONNX model file.vocabulary- The model file's vocabulary file.ids2Labels- The mapping of ids to labels.inferenceOptions-InferenceOptionsto control the inference.sentenceDetector- TheSentenceDetectorto be used.- Throws:
ai.onnxruntime.OrtException- Thrown if themodelcannot be loaded.IOException- Thrown if errors occurred loading themodelorvocabulary.
-
-
Method Details
-
find
- Specified by:
findin interfaceTokenNameFinder
-
clearAdaptiveData
public void clearAdaptiveData()- Specified by:
clearAdaptiveDatain interfaceTokenNameFinder
-