Class OnnxScoringModel

java.lang.Object
dev.langchain4j.model.scoring.onnx.OnnxScoringModel
All Implemented Interfaces:
ScoringModel

public class OnnxScoringModel extends Object
  • Constructor Details

    • OnnxScoringModel

      public OnnxScoringModel(String pathToModel, String pathToTokenizer)
    • OnnxScoringModel

      public OnnxScoringModel(String pathToModel, ai.onnxruntime.OrtSession.SessionOptions options, String pathToTokenizer)
    • OnnxScoringModel

      public OnnxScoringModel(String pathToModel, String pathToTokenizer, int modelMaxLength)
    • OnnxScoringModel

      public OnnxScoringModel(String pathToModel, ai.onnxruntime.OrtSession.SessionOptions options, String pathToTokenizer, int modelMaxLength, boolean normalize)
  • Method Details

    • model

      protected dev.langchain4j.model.scoring.onnx.OnnxScoringBertCrossEncoder model()
    • scoreAll

      public Response<List<Double>> scoreAll(List<TextSegment> segments, String query)
      Description copied from interface: ScoringModel
      Scores all provided TextSegments against a given query.
      Specified by:
      scoreAll in interface ScoringModel
      Parameters:
      segments - The list of TextSegments 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 TextSegments.