Package opennlp.dl.vectors
Klasse SentenceVectorsDL
java.lang.Object
opennlp.dl.AbstractDL
opennlp.dl.vectors.SentenceVectorsDL
- Alle implementierten Schnittstellen:
AutoCloseable
Facilitates the generation of sentence vectors using
a sentence-transformers model converted to ONNX.
-
Feldübersicht
Von Klasse geerbte Felder opennlp.dl.AbstractDL
ATTENTION_MASK, INPUT_IDS, TOKEN_TYPE_IDS
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSentenceVectorsDL
(File model, File vocabulary) Instantiates asentence detector
using ONNX models. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfloat[]
getVectors
(String sentence) Generates vectors given a sentence.Von Klasse geerbte Methoden opennlp.dl.AbstractDL
close, loadVocab
-
Konstruktordetails
-
SentenceVectorsDL
public SentenceVectorsDL(File model, File vocabulary) throws ai.onnxruntime.OrtException, IOException Instantiates asentence detector
using ONNX models.- Parameter:
model
- The file name of a sentence vectors ONNX model.vocabulary
- The file name of the vocabulary file for the model.- Löst aus:
ai.onnxruntime.OrtException
- Thrown if themodel
cannot be loaded.IOException
- Thrown if errors occurred loading themodel
orvocabulary
.
-
-
Methodendetails
-
getVectors
Generates vectors given a sentence.- Parameter:
sentence
- The input sentence.- Löst aus:
ai.onnxruntime.OrtException
- Thrown if an error occurs during inference.
-