Module org.elasticsearch.xcore
Class QuestionAnsweringConfig
java.lang.Object
org.elasticsearch.xpack.core.ml.inference.trainedmodel.QuestionAnsweringConfig
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,InferenceConfig,LenientlyParsedInferenceConfig,NlpConfig,StrictlyParsedInferenceConfig,NamedXContentObject
Question and Answer configuration
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig
DEFAULT_RESULTS_FIELD, DEFAULT_TOP_CLASSES_RESULTS_FIELD, RESULTS_FIELDFields inherited from interface org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig
CLASSIFICATION_LABELS, MINIMUM_NLP_SUPPORTED_VERSION, NUM_TOP_CLASSES, TOKENIZATION, VOCABULARYFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionQuestionAnsweringConfig(Integer numTopClasses, Integer maxAnswerLength, VocabularyConfig vocabularyConfig, Tokenization tokenization, String resultsField) QuestionAnsweringConfig(String question, int numTopClasses, int maxAnswerLength, VocabularyConfig vocabularyConfig, Tokenization tokenization, String resultsField) -
Method Summary
Modifier and TypeMethodDescriptionapply(InferenceConfigUpdate update) Return a copy of this with the settings updated by the values inupdate.booleanstatic QuestionAnsweringConfigfromXContentLenient(org.elasticsearch.xcontent.XContentParser parser) static QuestionAnsweringConfigfromXContentStrict(org.elasticsearch.xcontent.XContentParser parser) intAll nodes in the cluster must have at least this MlConfigVersion attributeAll communication in the cluster must use at least this versiongetName()intinthashCode()booleanbooleanisTargetTypeSupported(TargetType targetType) org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.core.ml.inference.trainedmodel.InferenceConfig
getDefaultInput, getMinimalSupportedVersion, getMinLicenseSupported, getMinLicenseSupportedForAction, incompatibleUpdateException, requestingImportance, validateTrainedModelInputMethods inherited from interface org.elasticsearch.xpack.core.ml.inference.trainedmodel.NlpConfig
supportsIngestPipeline, supportsPipelineAggregation, supportsSearchRescorerMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
MAX_ANSWER_LENGTH
public static final org.elasticsearch.xcontent.ParseField MAX_ANSWER_LENGTH -
QUESTION
public static final org.elasticsearch.xcontent.ParseField QUESTION -
DEFAULT_MAX_ANSWER_LENGTH
public static final int DEFAULT_MAX_ANSWER_LENGTH- See Also:
-
DEFAULT_NUM_TOP_CLASSES
public static final int DEFAULT_NUM_TOP_CLASSES- See Also:
-
-
Constructor Details
-
QuestionAnsweringConfig
public QuestionAnsweringConfig(@Nullable Integer numTopClasses, @Nullable Integer maxAnswerLength, @Nullable VocabularyConfig vocabularyConfig, @Nullable Tokenization tokenization, @Nullable String resultsField) -
QuestionAnsweringConfig
public QuestionAnsweringConfig(String question, int numTopClasses, int maxAnswerLength, VocabularyConfig vocabularyConfig, Tokenization tokenization, String resultsField) -
QuestionAnsweringConfig
- Throws:
IOException
-
-
Method Details
-
fromXContentStrict
public static QuestionAnsweringConfig fromXContentStrict(org.elasticsearch.xcontent.XContentParser parser) -
fromXContentLenient
public static QuestionAnsweringConfig fromXContentLenient(org.elasticsearch.xcontent.XContentParser parser) -
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein interfaceVersionedNamedWriteable
-
isTargetTypeSupported
- Specified by:
isTargetTypeSupportedin interfaceInferenceConfig
-
apply
Description copied from interface:InferenceConfigReturn a copy of this with the settings updated by the values inupdate.- Specified by:
applyin interfaceInferenceConfig- Parameters:
update- The update to apply- Returns:
- A new updated config
-
getMinimalSupportedMlConfigVersion
Description copied from interface:InferenceConfigAll nodes in the cluster must have at least this MlConfigVersion attribute- Specified by:
getMinimalSupportedMlConfigVersionin interfaceInferenceConfig
-
getMinimalSupportedTransportVersion
Description copied from interface:InferenceConfigAll communication in the cluster must use at least this version- Specified by:
getMinimalSupportedTransportVersionin interfaceInferenceConfig
-
getName
- Specified by:
getNamein interfaceNamedXContentObject- Returns:
- The name of the XContentObject that is to be serialized
-
equals
-
hashCode
public int hashCode() -
getVocabularyConfig
- Specified by:
getVocabularyConfigin interfaceNlpConfig- Returns:
- the vocabulary configuration that allows retrieving it
-
getTokenization
- Specified by:
getTokenizationin interfaceNlpConfig- Returns:
- the model tokenization parameters
-
getNumTopClasses
public int getNumTopClasses() -
getMaxAnswerLength
public int getMaxAnswerLength() -
getQuestion
-
getResultsField
- Specified by:
getResultsFieldin interfaceInferenceConfig
-
isAllocateOnly
public boolean isAllocateOnly()- Specified by:
isAllocateOnlyin interfaceInferenceConfig
-