Visual question answering

更新时间:
复制 MD 格式

The visual question answering template lets you ask and answer questions about images. You can connect a user-defined function (UDF) to a robot to handle the question and answer (Q&A) process. A single-turn conversation does not consider the context of previous interactions. A multi-turn conversation generates responses based on the context of the conversation.

Data format examples

Note

In CSV and XLSX formats, each column corresponds to a dataset field. In the Manifest format, each sub-field under the data field corresponds to a dataset field. You can customize the field name and select the corresponding name when you configure the dataset. Common image formats such as JPG and PNG are supported.

CSV and XLSX formats

image_url

oss://****.oss-cn-hangzhou.aliyuncs.com/iTAG/pic/1.jpg

oss://****.oss-cn-hangzhou.aliyuncs.com/iTAG/pic/2.jpg

For a demo file, see image_semantic_segmentation_data_demo.csv.

Manifest format (JSONL)

{"data":{"image_url":"oss://****.oss-cn-hangzhou.aliyuncs.com/iTAG/pic/1.jpg"}}
{"data":{"image_url":"oss://****.oss-cn-hangzhou.aliyuncs.com/iTAG/pic/10.jpg"}}
{"data":{"image_url":"oss://****.oss-cn-hangzhou.aliyuncs.com/iTAG/pic/11.jpg"}}

For a demo file, see image_semantic_segmentation_data_demo.manifest.

Configuration

Subject area (Required)

The Subject area is used to configure the subject field.

Click the subject, select the corresponding dataset, and then configure the parameters in the Configuration area on the right. The parameters are described as follows:

Parameter

Description

Title

You do not need to modify the default title.

Dataset field

Select the URL field for the topic image from the dataset fields. You can customize the field name.

Note:

You do not need to modify the default tooltip.

Click link to jump

This parameter is not configurable and has no effect.

Text highlight

This parameter is not configurable and has no effect.

Card style configuration

This parameter is not configurable and has no effect.

Question area (Optional)

The Question area is used to configure the text for the robot's questions.

Click a question and configure its parameters in the Configuration area on the right. The parameters are described as follows:

Parameter

Description

Title

Specify the question title.

Options

Note

This parameter is required when the answer type is Single-select, Multi-select, or Tree-select.

  • If the answer type is Single-select or Multi-select, you can configure options using Manual Entry or Dataset Import. The Dictionary Search feature is not available.

  • If the answer type is Tree-select, only manual entry is supported.

Placeholder text

Note

This parameter is required when the answer type is Single-line Text Box or Text Box with Markdown Preview.

Specify the placeholder text for a fill-in-the-blank question. This text guides user input.

Tooltip

Specify the text that appears when a user hovers over the question title.

Required

Specify whether this question is required. If you select this option, a validation check is performed when the user provides an answer.

Supported Search Options

Note

This parameter is required when the answer type is Single-select or Multi-select.

You can search for options after the configuration is complete.

Effective stage

Specify the stage at which the question is active. If you do not select a stage, the question is active throughout process by default.

Answer area (Optional)

The Answer area is used to configure questions about the robot's answers.

Click a question and configure its parameters in the Configuration area on the right. The parameters are described as follows:

Parameter

Description

Title

Specify the question title.

Placeholder text

Note

This parameter is required when the answer type is Single-line Text Box or Text Box with Markdown Preview.

Specify the placeholder text for a fill-in-the-blank question. This text guides user input.

Options

Note

This parameter is required when the type is Single-select, Multi-select, or Tree-select.

  • If the answer type is Single-select or Multi-select, you can configure options using Manual Entry or Dataset Import. The Dictionary Search feature is not available.

  • If the answer type is Tree-select, only manual entry is supported.

Tooltip

Specify the text that appears when a user hovers over the question title.

Enable search for options

Note

This parameter is required when the answer type is Single-select or Multi-select.

After the configuration is complete, you can search for options.

Required

Specify whether this question is required. If you select this option, a validation check is performed when the user provides an answer.

Effective stage

Specify the stage at which the question is active. If you do not select a stage, the question is active throughout process by default.

Global question area (Optional)

The Global question area is used to configure questions that apply to the entire subject.

Click a question and configure its parameters in the Configuration area on the right. The parameters are described as follows:

Parameter

Description

Title

You can customize the question title.

Placeholder text

Note

This parameter is required when the answer type is Single-line Text Box or Text Box with Markdown Preview.

Specify the placeholder text for a fill-in-the-blank question. This text guides user input.

Options

Note

This parameter is required when the answer type is Single-select, Multi-select, Tree-select, or Multi-select Tree.

  • If the answer type is Single-select or Multi-select, you can configure options using Manual Entry or Dataset Import. The Dictionary Search feature is not available.

  • If the answer type is Tree-select or Multi-select Tree, only manual entry is supported.

Tooltip

Specify the text that appears when a user hovers over the question title.

Required

Specify whether this question is required. If you select this option, a validation check is performed when the user provides an answer.

Supported search options

Note

This parameter is required when the answer type is Single-select or Multi-select.

After the configuration is complete, you can search for options.

Effective stage

Specify the stage at which the question is active. If you do not select a stage, the question is active throughout process by default.

Global configuration

The Global configuration section is used to configure the UDFs that the template will use.

Click image. In the area on the right, configure the Q&A robot by selecting its UDF and adding the required configuration parameters.

Important

Configure the UDF exactly as shown in the example. The input_data and MarkResult parameters ensure that the UDF correctly receives the input parameters. Do not change them.

  • The configuration for a single-turn conversation is as follows:

  • The configuration for a multi-turn conversation is as follows:

Operation demo

  1. Click to start the Q&A. The robot automatically asks a question. Answer the configured questions about the robot's question text. If you are not satisfied with the question, you can rewrite it.

  2. After you confirm the question text, click to continue the Q&A process. The robot automatically provides an answer to the question from the previous turn. Answer the configured questions about the answer text. If you are not satisfied with the answer, you can rewrite it.

  3. You can repeat this process as many times as needed.

Note

For a single-turn conversation template, the conversation history is not analyzed. For a multi-turn conversation template, the conversation history is analyzed.