ElementalInference / Client / create_question_set

create_question_set

ElementalInference.Client.create_question_set(**kwargs)

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.

See also: AWS API Documentation

Request Syntax

response = client.create_question_set(
    yesNo=[
        {
            'name': 'string',
            'question': 'string'
        },
    ],
    yesNoPerOption=[
        {
            'name': 'string',
            'question': 'string',
            'options': [
                {
                    'name': 'string',
                    'text': 'string'
                },
            ]
        },
    ],
    chooseOne=[
        {
            'name': 'string',
            'question': 'string',
            'options': [
                {
                    'name': 'string',
                    'text': 'string'
                },
            ]
        },
    ],
    name='string',
    tags={
        'string': 'string'
    }
)
Parameters:
  • yesNo (list) –

    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.

    • (dict) –

      A question that you ask Elemental Inference, which answers with yes or no. You specify it in the yesNo array of a question set.

      • name (string) – [REQUIRED]

        A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

      • question (string) – [REQUIRED]

        The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

  • yesNoPerOption (list) –

    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.

    • (dict) –

      A question that you ask Elemental Inference separately about each of its options. Elemental Inference answers yes or no for each option. Word the question so that it fits any of the options. For example, ask Is this overlay visible? with one option for each overlay. You specify it in the yesNoPerOption array of a question set.

      • name (string) – [REQUIRED]

        A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

      • question (string) – [REQUIRED]

        The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

      • options (list) – [REQUIRED]

        The options that you ask the question about. You can specify from 1 to 50 options. Each option counts as one item toward the limit of 100 scored items in a version.

        • (dict) –

          An option in a yesNoPerOption question or a chooseOne question.

          • name (string) – [REQUIRED]

            A name for the option. The name must be unique among the options of the question. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

          • text (string) – [REQUIRED]

            The text of the option. The text must be unique among the options of the question, ignoring case. The text can be up to 16 bytes, encoded in UTF-8. It can contain the same characters as the text of a question.

  • chooseOne (list) –

    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.

    • (dict) –

      A question that you ask Elemental Inference, which answers by choosing one of its options. You specify it in the chooseOne array of a question set.

      • name (string) – [REQUIRED]

        A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

      • question (string) – [REQUIRED]

        The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

      • options (list) – [REQUIRED]

        The options that Elemental Inference chooses from. You can specify from 2 to 26 options. The question counts as one item toward the limit of 100 scored items in a version, regardless of how many options it has.

        • (dict) –

          An option in a yesNoPerOption question or a chooseOne question.

          • name (string) – [REQUIRED]

            A name for the option. The name must be unique among the options of the question. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

          • text (string) – [REQUIRED]

            The text of the option. The text must be unique among the options of the question, ignoring case. The text can be up to 16 bytes, encoded in UTF-8. It can contain the same characters as the text of a question.

  • name (string) –

    [REQUIRED]

    A user-friendly name for this question set.

  • tags (dict) –

    Optional tags to associate with the question set. You can also add tags later, using TagResource.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'yesNo': [
        {
            'name': 'string',
            'question': 'string'
        },
    ],
    'yesNoPerOption': [
        {
            'name': 'string',
            'question': 'string',
            'options': [
                {
                    'name': 'string',
                    'text': 'string'
                },
            ]
        },
    ],
    'chooseOne': [
        {
            'name': 'string',
            'question': 'string',
            'options': [
                {
                    'name': 'string',
                    'text': 'string'
                },
            ]
        },
    ],
    'arn': 'string',
    'id': 'string',
    'name': 'string',
    'version': 'string',
    'description': 'string',
    'latestVersion': 'string',
    'sha256': 'string',
    'references': [
        'string',
    ],
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • yesNo (list) –

      The yesNo questions that you specified in the request, in the order that you specified them. Elemental Inference doesn’t return this property if the request didn’t include any yesNo questions.

      • (dict) –

        A question that you ask Elemental Inference, which answers with yes or no. You specify it in the yesNo array of a question set.

        • name (string) –

          A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

        • question (string) –

          The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

    • yesNoPerOption (list) –

      The yesNoPerOption questions that you specified in the request, in the order that you specified them. Elemental Inference doesn’t return this property if the request didn’t include any yesNoPerOption questions.

      • (dict) –

        A question that you ask Elemental Inference separately about each of its options. Elemental Inference answers yes or no for each option. Word the question so that it fits any of the options. For example, ask Is this overlay visible? with one option for each overlay. You specify it in the yesNoPerOption array of a question set.

        • name (string) –

          A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

        • question (string) –

          The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

        • options (list) –

          The options that you ask the question about. You can specify from 1 to 50 options. Each option counts as one item toward the limit of 100 scored items in a version.

          • (dict) –

            An option in a yesNoPerOption question or a chooseOne question.

            • name (string) –

              A name for the option. The name must be unique among the options of the question. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

            • text (string) –

              The text of the option. The text must be unique among the options of the question, ignoring case. The text can be up to 16 bytes, encoded in UTF-8. It can contain the same characters as the text of a question.

    • chooseOne (list) –

      The chooseOne questions that you specified in the request, in the order that you specified them. Elemental Inference doesn’t return this property if the request didn’t include any chooseOne questions.

      • (dict) –

        A question that you ask Elemental Inference, which answers by choosing one of its options. You specify it in the chooseOne array of a question set.

        • name (string) –

          A name for the question. The name must be unique among all the questions in the version, across all question types. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

        • question (string) –

          The text of the question. The text can be up to 256 bytes, encoded in UTF-8. It can contain letters in any language, combining marks, digits, spaces, and the following characters: . , ? ! ' " ( ) - : ; / & %, plus the curly apostrophe and quotation marks (U+2019, U+201C, and U+201D).

        • options (list) –

          The options that Elemental Inference chooses from. You can specify from 2 to 26 options. The question counts as one item toward the limit of 100 scored items in a version, regardless of how many options it has.

          • (dict) –

            An option in a yesNoPerOption question or a chooseOne question.

            • name (string) –

              A name for the option. The name must be unique among the options of the question. The name can be up to 64 characters. It must start with a letter or an underscore, and can contain only the letters A-Z and a-z, the digits 0-9, and underscores.

            • text (string) –

              The text of the option. The text must be unique among the options of the question, ignoring case. The text can be up to 16 bytes, encoded in UTF-8. It can contain the same characters as the text of a question.

    • arn (string) –

      The ARN of the question set.

    • id (string) –

      A unique ID that Elemental Inference assigns to the question set.

    • name (string) –

      The name that you specified in the request.

    • version (string) –

      The version that this response describes. For CreateQuestionSet, the version is always DRAFT.

    • description (string) –

      The description of the version. Elemental Inference doesn’t return this property for CreateQuestionSet, because the DRAFT version has no description.

    • latestVersion (string) –

      The number of the highest version that you have published for this question set. Elemental Inference doesn’t return this property for CreateQuestionSet, because a new question set has no published versions.

    • sha256 (string) –

      The SHA-256 hash of the DRAFT version, as 64 lowercase hexadecimal characters. The hash covers the name of the question set and its questions. You can specify this value in a CreateQuestionSetVersion request, so that Elemental Inference publishes DRAFT only if it hasn’t changed.

    • references (list) –

      A list of feed IDs that reference this version of the question set. For a new question set, the list is empty.

      • (string) –

    • tags (dict) –

      Any tags that you included when you created the question set.

      • (string) –

        • (string) –

Exceptions