Creates a question set. Use a question set to get answers about content that's specific to your business, in addition to the built-in contextual metadata classifications. A question set contains your own questions. You ask Elemental Inference these questions about each shot or scene of the media in a contextual metadata output, and Elemental Inference answers each question with scores. To use a question set, reference it in the customQuestions property of the contextual metadata configuration of a feed output.
CreateQuestionSet creates the question set with a DRAFT version that contains the questions in the request. To change DRAFT, use UpdateQuestionSet. To publish DRAFT as a numbered version, use CreateQuestionSetVersion. You can't change a published version.
A question set can contain the following types of questions. You must specify at least one question.
-
yesNo – Elemental Inference answers yes or no.
-
yesNoPerOption – Elemental Inference answers yes or no for each option.
-
chooseOne – Elemental Inference chooses one of the options.
A version can contain up to 100 scored items, where each yesNo question, each option of a yesNoPerOption question, and each chooseOne question counts as one item. The name of each question must be unique across all three types.
Parameters:
-
yes_no
(Optional[YesNoQuestionList], default:
None
)
–
An array of questions that Elemental Inference answers with yes or no. You can specify up to 50 yesNo questions. An empty array is the same as omitting this property.
-
yes_no_per_option
(Optional[YesNoPerOptionQuestionList], default:
None
)
–
An array of questions that you ask about each of their options. Elemental Inference answers yes or no for each option. You can specify up to 10 yesNoPerOption questions. An empty array is the same as omitting this property.
-
choose_one
(Optional[ChooseOneQuestionList], default:
None
)
–
An array of questions that Elemental Inference answers by choosing one of their options. You can specify up to 10 chooseOne questions. An empty array is the same as omitting this property.
-
name
(ResourceName)
–
A user-friendly name for this question set.
-
tags
(Optional[TagMap], default:
None
)
–
Optional tags to associate with the question set. You can also add tags later, using TagResource.
Raises:
-
AccessDeniedException
–
You do not have sufficient access to perform this action.
-
ConflictException
–
The request could not be completed due to a conflict.
-
InternalServerErrorException
–
An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support.
-
ServiceQuotaExceededException
–
The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase.
-
TooManyRequestException
–
The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying.
-
ValidationException
–
The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_elementalinference/_services/elemental_inference.py
| def create_question_set(
self,
name: "capo_elementalinference.types.resource_name.ResourceName",
*,
config_overrides: Optional[ElementalInferenceClientConfig] = None,
yes_no: Optional[
"capo_elementalinference.types.yes_no_question_list.YesNoQuestionList"
] = None,
yes_no_per_option: Optional[
"capo_elementalinference.types.yes_no_per_option_question_list.YesNoPerOptionQuestionList"
] = None,
choose_one: Optional[
"capo_elementalinference.types.choose_one_question_list.ChooseOneQuestionList"
] = None,
tags: Optional["capo_elementalinference.types.tag_map.TagMap"] = None,
) -> "capo_elementalinference.types.create_question_set_response.CreateQuestionSetResponse":
"""<p>Creates a question set. Use a question set to get answers about content that's specific to your business, in addition to the built-in contextual metadata classifications. A question set contains your own questions. You ask Elemental Inference these questions about each shot or scene of the media in a contextual metadata output, and Elemental Inference answers each question with scores. To use a question set, reference it in the customQuestions property of the contextual metadata configuration of a feed output. </p> <p>CreateQuestionSet creates the question set with a DRAFT version that contains the questions in the request. To change DRAFT, use UpdateQuestionSet. To publish DRAFT as a numbered version, use CreateQuestionSetVersion. You can't change a published version. </p> <p>A question set can contain the following types of questions. You must specify at least one question. </p> <ul> <li> <p>yesNo – Elemental Inference answers yes or no.</p> </li> <li> <p>yesNoPerOption – Elemental Inference answers yes or no for each option.</p> </li> <li> <p>chooseOne – Elemental Inference chooses one of the options.</p> </li> </ul> <p>A version can contain up to 100 scored items, where each yesNo question, each option of a yesNoPerOption question, and each chooseOne question counts as one item. The name of each question must be unique across all three types. </p>
Args:
yes_no: <p>An array of questions that Elemental Inference answers with yes or no. You can specify up to 50 yesNo questions. An empty array is the same as omitting this property. </p>
yes_no_per_option: <p>An array of questions that you ask about each of their options. Elemental Inference answers yes or no for each option. You can specify up to 10 yesNoPerOption questions. An empty array is the same as omitting this property. </p>
choose_one: <p>An array of questions that Elemental Inference answers by choosing one of their options. You can specify up to 10 chooseOne questions. An empty array is the same as omitting this property. </p>
name: <p>A user-friendly name for this question set.</p>
tags: <p>Optional tags to associate with the question set. You can also add tags later, using TagResource. </p>
Raises:
capo_elementalinference.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_elementalinference.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict.</p>
capo_elementalinference.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support. </p>
capo_elementalinference.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase. </p>
capo_elementalinference.errors.too_many_request_exception.TooManyRequestException: <p>The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying. </p>
capo_elementalinference.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying. </p>
capo_elementalinference.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_elementalinference.types.create_question_set_request.CreateQuestionSetRequest]",
) -> OperationResponse[
"capo_elementalinference.types.create_question_set_response.CreateQuestionSetResponse"
]:
import capo_elementalinference._operations.elemental_inference.create_question_set
output, http_response = (
capo_elementalinference._operations.elemental_inference.create_question_set.create_question_set(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateQuestionSet")
)
input_: capo_elementalinference.types.create_question_set_request.CreateQuestionSetRequest = {
"name": name
}
if yes_no is not None:
input_["yes_no"] = yes_no
if yes_no_per_option is not None:
input_["yes_no_per_option"] = yes_no_per_option
if choose_one is not None:
input_["choose_one"] = choose_one
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|