Updated on 2025-05-20 GMT+08:00

Configuring a Question Template

A question template is a predefined question structure. When using an intelligent analysis assistant for Q&A, it automatically assesses the similarity between the input question and the template. If the similarity meets the threshold, the assistant returns the template. Configuring question templates ensures that the responses from the intelligent analysis assistant are more targeted and accurate.

Prerequisites

Procedure

  1. Log in to the DataArts Insight console.
  2. Click in the upper left corner of the management console to select a region. Then, select an enterprise project in the upper right corner.
  3. On the top menu of the console, click Project. On the displayed My Projects page, click the name of the desired project.
  4. In the navigation pane on the left, choose Q&A Management > Intelligent Analysis Assistants.
  5. Click the name of the intelligent analysis assistant.
  6. In the navigation pane on the left, choose Q&A Settings > Question Templates. On the displayed page, click Add Q&A Template in the upper right corner. Then, set the parameters based on Table 1.
    In this example, select Physical SQL for SQL Type to create a question template named "Product prices in different categories in a region in 2024" and enter "Product prices in different categories in a region in 2024" in the test question to check whether the similarity between the two questions meets the threshold (95%). If the threshold is met, the question template will be automatically returned during the Q&A with the intelligent analysis assistant.
    Figure 1 Creating a question template

    Table 1 Parameters for creating a question template

    Parameter

    Description

    Template Name

    Template name. The name can contain up to 64 characters.

    SQL Type

    • Semantic SQL: Data query requirements are described in natural language, without involving specific database implementation.
    • Physical SQL: Physical SQL statements are specific SQL statements that can be directly executed in the database during database interaction.

    Datasets

    Dataset associated with the question template. You can only select the dataset associated with the intelligent analysis assistant.

    Question Configuration

    Enter a template question. If the similarity between the question asked by the intelligent analysis assistant and the template question reaches 95%, the assistant returns the question template.

    Q&A Test

    • Test Questions: To evaluate the effectiveness of the question template, input the question intended for the intelligent analysis assistant; it will display the similarity to the template question and the answer to the template question.
    • Template Scope: Selecting Current Issue Template tests only the current question template. Selecting Simulate real Q&A tests all question templates.

Configuring Wildcards

  1. In the navigation pane on the left, choose Q&A Settings > Question Templates. On the displayed page, click the Wildcard Management tab.
  2. Click Add Wildcards in the upper right corner. In the dialog box that appears, set parameters according to Table 2. In this example, the wildcard product of the custom enumeration value type is configured, and the matching content is set to phone and car.
    Figure 2 Adding a wildcard
    Table 2 Parameters for adding a wildcard

    Parameter

    Description

    Wildcard Name

    Wildcard name. The name can contain up to 32 characters. Only letters, numbers, underscores (_), and hyphens (-) are allowed.

    Type

    In addition to built-in wildcards (datePeriod, fieldValue, and num), you can set and use wildcards of the Custom Enumeration value, Field, and Time limit types. After the configuration is complete, you can use the wildcard in question configurations and SQL statements.

    • datePeriod: Automatically matches date ranges. For example, entering ${datePeriod} product price will match phrases like "this year's product price" or "product price over the past three months".
    • fieldValue: Automatically matches field values. For example, entering ${fieldValue.'product_type'} will match the values contained in the product_type field.
    • num: Automatically matches numbers. For example, entering product profit in year ${num} will match phrases containing numbers, such as "product profit in year 2022".
      NOTE:

      Note: If the wildcard involves field values, you must enable the "allow search" option for the corresponding field in the dataset's visualization configuration; otherwise, the matching will not be possible.

  3. In the navigation pane on the left, choose Q&A Settings > Question Templates. On the displayed page, click Add Q&A Template in the upper right corner and use the configured wildcard. After entering ${product} price in the question configuration area, the system will automatically match it with "mobile phone price" or "car price" when entered in the intelligent analysis assistant. The intelligent analysis assistant will then return the configured question template.
    Figure 3 Adding a wildcard