Class OnnxScoringModel
java.lang.Object
dev.langchain4j.model.scoring.onnx.OnnxScoringModel
- All Implemented Interfaces:
ScoringModel
-
Constructor Summary
ConstructorDescriptionOnnxScoringModel
(String pathToModel, ai.onnxruntime.OrtSession.SessionOptions options, String pathToTokenizer) OnnxScoringModel
(String pathToModel, ai.onnxruntime.OrtSession.SessionOptions options, String pathToTokenizer, int modelMaxLength, boolean normalize) OnnxScoringModel
(String pathToModel, String pathToTokenizer) OnnxScoringModel
(String pathToModel, String pathToTokenizer, int modelMaxLength) -
Method Summary
Modifier and TypeMethodDescriptionprotected dev.langchain4j.model.scoring.onnx.OnnxScoringBertCrossEncoder
model()
scoreAll
(List<TextSegment> segments, String query) Scores all providedTextSegment
s against a given query.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.scoring.ScoringModel
score, score
-
Constructor Details
-
OnnxScoringModel
-
OnnxScoringModel
-
OnnxScoringModel
-
OnnxScoringModel
-
-
Method Details
-
model
protected dev.langchain4j.model.scoring.onnx.OnnxScoringBertCrossEncoder model() -
scoreAll
Description copied from interface:ScoringModel
Scores all providedTextSegment
s against a given query.- Specified by:
scoreAll
in interfaceScoringModel
- Parameters:
segments
- The list ofTextSegment
s to score.query
- The query against which to score the segments.- Returns:
- the list of scores. The order of scores corresponds to the order of
TextSegment
s.
-