Class TextSimilarityMLInput

java.lang.Object
org.opensearch.ml.common.input.MLInput
org.opensearch.ml.common.input.nlp.TextSimilarityMLInput
All Implemented Interfaces:
org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentObject, Input

public class TextSimilarityMLInput extends MLInput
MLInput which supports a text similarity algorithm Inputs are a query and a list of texts. Outputs are real numbers Use this for Cross Encoder models
  • Constructor Details

    • TextSimilarityMLInput

      public TextSimilarityMLInput(FunctionName algorithm, MLInputDataset dataset)
    • TextSimilarityMLInput

      public TextSimilarityMLInput(org.opensearch.core.common.io.stream.StreamInput in) throws IOException
      Throws:
      IOException
    • TextSimilarityMLInput

      public TextSimilarityMLInput(org.opensearch.core.xcontent.XContentParser parser, FunctionName functionName) throws IOException
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Specified by:
      writeTo in interface org.opensearch.core.common.io.stream.Writeable
      Overrides:
      writeTo in class MLInput
      Throws:
      IOException
    • toXContent

      public org.opensearch.core.xcontent.XContentBuilder toXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.opensearch.core.xcontent.ToXContent
      Overrides:
      toXContent in class MLInput
      Throws:
      IOException