Class QueryAnswer
-
Constructor Summary
ConstructorsConstructorDescriptionQueryAnswer(QueryAnswerType answerType) Creates a new instance ofQueryAnswer. -
Method Summary
Modifier and TypeMethodDescriptionGets the type of answers to generate.getCount()Gets the number of answers to generate.Gets the maximum character length of answers.Gets the confidence threshold an answer must match to be included as an answer to the query of answers.Sets the number of answers to generate.setMaxCharLength(Integer maxCharLength) Sets the maximum character length of answers.setThreshold(Double threshold) Sets the confidence threshold an answer must match to be included as an answer to the query of answers.
-
Constructor Details
-
QueryAnswer
Creates a new instance ofQueryAnswer.- Parameters:
answerType- The type of answers to generate.
-
-
Method Details
-
getAnswerType
Gets the type of answers to generate.- Returns:
- The type of answers to generate.
-
getCount
Gets the number of answers to generate.The number of answers to return is optional and will default to 1.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Returns:
- The number of answers to generate.
-
setCount
Sets the number of answers to generate.The number of answers to return is optional and will default to 1.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Parameters:
count- The number of answers to generate.- Returns:
- The QueryAnswer object itself.
-
getThreshold
Gets the confidence threshold an answer must match to be included as an answer to the query of answers.The threshold is optional and will default to 0.7.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Returns:
- The confidence threshold an answer must match to be included as an answer to the query of answers.
-
setThreshold
Sets the confidence threshold an answer must match to be included as an answer to the query of answers.The threshold is optional and will default to 0.7.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Parameters:
threshold- The confidence threshold an answer must match to be included as an answer to the query of answers.- Returns:
- The QueryAnswer object itself.
-
getMaxCharLength
Gets the maximum character length of answers.The maximum character length of answers is optional.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Returns:
- The maximum character length of answers.
-
setMaxCharLength
Sets the maximum character length of answers.The maximum character length of answers is optional.
The value only takes effect when
getAnswerType()isQueryAnswerType.EXTRACTIVE.- Parameters:
maxCharLength- The maximum character length of answers.- Returns:
- The QueryAnswer object itself.
-