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
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.ml.common.input.MLInput
MLInput.MLInputBuilderNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Field Summary
Fields inherited from class org.opensearch.ml.common.input.MLInput
algorithm, ALGORITHM_FIELD, CONTEXT_FIELD, INPUT_DATA_FIELD, INPUT_INDEX_FIELD, INPUT_QUERY_FIELD, inputDataset, ML_PARAMETERS_FIELD, parameters, PARAMETERS_FIELD, QUERY_TEXT_FIELD, QUESTION_FIELD, RETURN_BYTES_FIELD, RETURN_NUMBER_FIELD, TARGET_RESPONSE_FIELD, TARGET_RESPONSE_POSITIONS_FIELD, TEXT_DOCS_FIELDFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTextSimilarityMLInput(org.opensearch.core.common.io.stream.StreamInput in) TextSimilarityMLInput(org.opensearch.core.xcontent.XContentParser parser, FunctionName functionName) TextSimilarityMLInput(FunctionName algorithm, MLInputDataset dataset) -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.core.xcontent.XContentBuildertoXContent(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) voidwriteTo(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class org.opensearch.ml.common.input.MLInput
builder, canEqual, equals, getAlgorithm, getFunctionName, getInputDataset, getParameters, getVersion, hashCode, parse, setAlgorithm, setInputDataset, setParameters, setVersion, toBuilder, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
TextSimilarityMLInput
-
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
- Specified by:
writeToin interfaceorg.opensearch.core.common.io.stream.Writeable- Overrides:
writeToin classMLInput- 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:
toXContentin interfaceorg.opensearch.core.xcontent.ToXContent- Overrides:
toXContentin classMLInput- Throws:
IOException
-