Package opennlp.dl.doccat
Klasse DocumentCategorizerDL
java.lang.Object
opennlp.dl.AbstractDL
opennlp.dl.doccat.DocumentCategorizerDL
- Alle implementierten Schnittstellen:
AutoCloseable
,DocumentCategorizer
An implementation of
DocumentCategorizer
that performs document classification
using ONNX models.- Siehe auch:
-
Feldübersicht
Von Klasse geerbte Felder opennlp.dl.AbstractDL
ATTENTION_MASK, INPUT_IDS, TOKEN_TYPE_IDS
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDocumentCategorizerDL
(File model, File vocabulary, File config, ClassificationScoringStrategy classificationScoringStrategy, InferenceOptions inferenceOptions) Instantiates adocument categorizer
using ONNX models.DocumentCategorizerDL
(File model, File vocabulary, Map<Integer, String> categories, ClassificationScoringStrategy classificationScoringStrategy, InferenceOptions inferenceOptions) Instantiates adocument categorizer
using ONNX models. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdouble[]
categorize
(String[] strings) double[]
categorize
(String[] strings, Map<String, Object> map) getAllResults
(double[] doubles) getBestCategory
(double[] doubles) getCategory
(int i) int
int
sortedScoreMap
(String[] strings) Von Klasse geerbte Methoden opennlp.dl.AbstractDL
close, loadVocab
-
Konstruktordetails
-
DocumentCategorizerDL
public DocumentCategorizerDL(File model, File vocabulary, Map<Integer, String> categories, ClassificationScoringStrategy classificationScoringStrategy, InferenceOptions inferenceOptions) throws IOException, ai.onnxruntime.OrtExceptionInstantiates adocument categorizer
using ONNX models.- Parameter:
model
- The ONNX model file.vocabulary
- The model file's vocabulary file.categories
- The categories.classificationScoringStrategy
- Implementation ofClassificationScoringStrategy
used to calculate the classification scores given the score of each individual document part.inferenceOptions
-InferenceOptions
to control the inference.- Löst aus:
ai.onnxruntime.OrtException
- Thrown if themodel
cannot be loaded.IOException
- Thrown if errors occurred loading themodel
orvocabulary
.
-
DocumentCategorizerDL
public DocumentCategorizerDL(File model, File vocabulary, File config, ClassificationScoringStrategy classificationScoringStrategy, InferenceOptions inferenceOptions) throws IOException, ai.onnxruntime.OrtException Instantiates adocument categorizer
using ONNX models.- Parameter:
model
- The ONNX model file.vocabulary
- The model file's vocabulary file.config
- The model's config file. The file will be used to determine the classification categories.classificationScoringStrategy
- Implementation ofClassificationScoringStrategy
used to calculate the classification scores given the score of each individual document part.inferenceOptions
-InferenceOptions
to control the inference.- Löst aus:
ai.onnxruntime.OrtException
- Thrown if themodel
cannot be loaded.IOException
- Thrown if errors occurred loading themodel
orvocabulary
.
-
-
Methodendetails
-
categorize
- Angegeben von:
categorize
in SchnittstelleDocumentCategorizer
-
categorize
- Angegeben von:
categorize
in SchnittstelleDocumentCategorizer
-
getBestCategory
- Angegeben von:
getBestCategory
in SchnittstelleDocumentCategorizer
-
getIndex
- Angegeben von:
getIndex
in SchnittstelleDocumentCategorizer
-
getCategory
- Angegeben von:
getCategory
in SchnittstelleDocumentCategorizer
-
getNumberOfCategories
public int getNumberOfCategories()- Angegeben von:
getNumberOfCategories
in SchnittstelleDocumentCategorizer
-
getAllResults
- Angegeben von:
getAllResults
in SchnittstelleDocumentCategorizer
-
scoreMap
- Angegeben von:
scoreMap
in SchnittstelleDocumentCategorizer
-
sortedScoreMap
- Angegeben von:
sortedScoreMap
in SchnittstelleDocumentCategorizer
-