Text Embedding
The Text Embedding operator converts input text into normalized vector representations. This topic describes how to configure the Text Embedding operator.
Prerequisites
-
You must purchase the unstructured data feature for the current instance to use the workflow feature.
-
A workflow has been created. 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 an input or output for the operator.
Supported file formats
The Text Embedding operator supports files in the following formats: md, txt, html, csv, and json.
Procedure
-
On the Dataphin homepage, in the top navigation bar, choose Development > Data Development.
-
On the Develop page, select a project from the top navigation bar.
-
In the left-side navigation pane, choose Data Processing > Workflow. In the workflow list on the left, click the target workflow to open its canvas. From the operator library on the left, drag the Text Embedding operator to the canvas. In the Text Embedding panel that opens on the right, configure the following parameters.
Parameter
Description
Step name
Enter a name for the operator. The name can contain any characters and be up to 256 characters long.
Input configuration
Dataset
Select the dataset to process. You can choose a hybrid dataset or a table dataset. After selecting a dataset, you must also select a version. By default, the first version in ascending order is selected.
When this operator is connected to an upstream operator, the input dataset is typically the output from that upstream operator.
Input field
Select the source field from the input dataset that contains the text to be processed. You can select any field from the dataset's metadata table.
Filter condition (Optional)
Use SQL syntax. You only need to enter the part of the query that comes after the
WHEREclause. System global variables, such as ${bizdate}, are supported.Model configuration
Model
After you configure the output fields, the system automatically sets this parameter based on the vector configuration of those fields. You cannot change this parameter.
Note-
For information about the pricing factors of system models, see Built-in models supported by smart applications.
-
If you have purchased the advanced license package for custom models, no credits are deducted. Otherwise, you are charged at a rate of 0.2x.
Vector dimensions (Optional)
The model converts text into a high-dimensional vector, where each dimension captures a specific semantic feature of the text. After you configure the output fields, the system automatically sets this parameter based on the vector configuration of those fields. You cannot change this parameter.
Output configuration
Dataset
You can select the Source Dataset or Other Datasets. If the metadata table of the source dataset does not have a primary key, the output dataset defaults to Other Datasets.
-
When you select other datasets, you also need to specify a hybrid dataset or table dataset and its version as the output dataset. The first version of this dataset is selected by default. You can also select other versions of the source dataset.
-
When you select a source dataset, the metadata generated 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, update on primary key conflict is selected by default. If a primary key does not exist, append data is selected by default.
-
Append data: Appends new data to the target table. This action fails if a primary key or constraint conflict occurs.
-
Update on primary key conflict: If a primary key or constraint conflict occurs, the system deletes the existing row with the duplicate primary key before inserting the new data.
-
Overwrite: Deletes all existing data from the target table before writing the new data.
NoteIf you select Source Dataset as the output dataset, the loading policy only supports Update on Primary Key Conflict.
Field mapping
The Text Embedding operator has one fixed output field:
vector_result: The vectorized result, which is a floating-point vector.By default, the operator maps its output field to a field with the same name in the output dataset. You can also manually select a target field for custom mapping. Additionally, you can map passthrough fields from the source dataset to the target dataset. You can manage field mappings in the following ways:
-
Add Output Field: Adds a new, empty row for field mapping. This option is available only when the output dataset is set to Other Datasets.
-
Batch Mapping: Allows you to select batch manual mapping, mapping by name, or mapping by row index. This option is available only when the output dataset is set to Other Datasets.
-
Delete a mapping: Click the Delete icon to remove the field mapping for that row. You cannot delete the mapping for the operator's fixed output field.
-
-
After you finish the configuration, click Save on the toolbar at the top of the canvas.
After configuring this operator, you can continue to build the workflow by adding upstream or downstream operators.