Text inference (LLM)

Updated at:

The Text Inference (LLM) operator uses a large language model to perform inference on text data in an input dataset. This topic describes how to configure the Text Inference (LLM) operator.

Prerequisites

  • To use the workflow feature, you must first purchase the unstructured data feature for your instance.

  • You have created a workflow. For more information, see Create and manage workflows.

Permissions

In a Basic project, project administrators, developers, analysts, and custom project roles with the Dataset - Use permission can use any dataset in the project as the operator's input or output.

Supported file formats

The Text Inference (LLM) operator processes data by parsing field values from a metadata table.

Procedure

  1. On the Dataphin homepage, choose R&D > Data Development from the top navigation bar.

  2. On the Develop page, select a Project from the top navigation bar.

  3. In the left-side navigation pane, choose Data Processing > Workflow. In the Workflow list, click your target workflow to open the canvas. Drag the Text Inference (LLM) operator from the Operator Library on the left onto the canvas. Then, configure the following parameters in the Text Inference (LLM) panel on the right.

    Parameter

    Description

    Step name

    Enter a name for the operator. The name can contain any characters and must not exceed 256 characters.

    Input settings

    Dataset

    Select the dataset to process. You can select a Mixed Dataset or a Table Dataset. After you select the dataset, you must also select its Version. By default, the first version of the dataset in ascending order is selected.

    When this operator is downstream from another operator, this dataset is typically the output of the upstream operator.

    Input field

    Select a field from the metadata table of the input dataset. The system automatically processes the field based on its data type:

    • If the field is a URL, the system fetches the linked resource and parses its content. Supported file formats include .txt, .md, .csv, .json, .xml, and .html.

    • If the field is not a URL, the system treats the field value as plain text.

    Note

    Estimate the document size after parsing. If the input exceeds the model's maximum input length, the system may truncate the content or reject the request, which can compromise the integrity of the analysis results.

    Filter (Optional)

    Enter the filter conditions that follow a WHERE clause in a SQL statement. You can use global system variables, such as ${bizdate} for the business date.

    Model settings

    Model

    Specify the model for this operator. You can only select models that are of the Text type and are Enabled in Intelligent Application Management > Model Configuration.

    Note
    • Only models compatible with the OpenAI protocol are supported.

    • For the pricing factors of system models, see Built-in models supported by Intelligent Application.

    • If you have purchased the advanced authorization package for proprietary models, no Credits are deducted. Otherwise, a billing factor of 0.2x is applied.

    Prompt

    Enter a prompt to instruct the large language model. Use it to define the task, specify a response role, and set the output format to guide the model's response. You can drag the lower-right corner of the text box to resize it.

    Multi-column output (Optional)

    This feature is disabled by default. When enabled, the system automatically appends constraints to your prompt to enforce a JSON output format. Do not include any output format instructions in your prompt to avoid conflicts with the system's constraints.

    When enabled, a list of multi-column output fields appears. You can manage the fields in the following ways:

    • Add field: Click to open the Add field dialog box. Configure the field's Name, Type, Description, and Example, and then click OK to add it as a new row to the list.

    • Import JSON: Click to open the Import JSON dialog box, where you can enter JSON content. Fields that already exist in the list are automatically populated in the JSON, which you can edit as needed. After you confirm the content, click OK.

    • Delete field: Click the Delete icon to remove the corresponding field row.

    Maximum tokens (Optional)

    The maximum number of tokens to generate in the output. Generation stops when this limit is reached. The default is 4,096. This field can be left empty.

    Internet search, Deep thinking (Optional)

    This is disabled by default but can be manually enabled. The deep thinking feature can be enabled only for models that support Thinking Mode Selection in Intelligent Application > Model Call Configuration.

    Output settings

    Dataset

    You can select a Source Dataset or an Other Dataset. If the metadata table of the source dataset does not have a primary key, the output dataset defaults to Other Dataset.

    If you select Other Dataset, you must also specify a Mixed Dataset or a Table Dataset and its Version as the output dataset. By default, the first version in ascending order is selected. You can also select other versions of the source dataset.

    If you select Source Dataset, the metadata produced by the operator is written to the metadata table that corresponds to the same version of the source dataset.

    Loading policy

    If the metadata table of the selected output dataset contains a primary key, the default option is to update data when a primary key conflict occurs. If no primary key exists, the default option is to append data.

    • Append data: Appends new data to the destination table. If a primary key or constraint conflict occurs, the system reports an error.

    • Update on primary key conflict: If a primary key or constraint conflict occurs, the system deletes the existing row and then inserts the new row.

    • Overwrite: Deletes all data in the target table before writing the new data.

    Note

    When the output dataset is set to Source Dataset, the only supported loading policy is Update on primary key conflict.

    Field mapping

    If multi-column output is disabled, the operator outputs a single answer field. Otherwise, the output includes all fields configured in the multi-column output list.

    By default, the operator's output fields are mapped to fields with the same names in the output dataset. You can also manually select target fields for custom mapping. Additionally, you can map pass-through fields from the source dataset to the target dataset. You can manage field mappings in the following ways:

    • Add output field: Click to add a new blank field mapping row. This feature is supported only when the output dataset is Other Dataset.

    • Batch map: Click to choose batch manual mapping, same-name mapping, or same-row mapping. This feature is supported only when the output dataset is Other Dataset.

    • Delete mapping: You cannot delete mappings for the answer field and multi-column output fields here. To remove a mapping for a multi-column field, delete the field itself from the multi-column output list. For other manually added fields, click the Delete icon to remove the mapping row.

  4. After you complete the configuration, click Save in the top menu bar of the canvas.

    After you configure an individual operator, you can continue to build the workflow by adding upstream or downstream operators.