Use the machine reading comprehension predict component to make batch predictions with models trained by the machine reading comprehension training component.
Limits
Only Deep Learning Containers (DLC) resources are supported.
Configure the component in Machine Learning Designer
-
Input ports
Input port
Data type
Recommended upstream component
Required
input saved model
OSS
Yes
Data for Prediction
OSS
Yes
-
Component parameters
Configure the component on the pipeline page of Machine Learning Designer.
Tab
Parameter
Description
Fields Setting
Language
The language of the input file. Default value: zh.
-
zh
-
en
Input Schema
The data schema of each column in the input file. Separate multiple columns with commas (,). Default value: qas_id:str:1,context_text:str:1,question_text:str:1,answer_text:str:1,start_position_character:str:1,title:str:1.
Question Column
The column that contains questions in the input file. Default value: question_text.
Context Column
The column that contains text passages in the input file. Default value: context_text.
Answer Column
The column that contains answers in the input file. Default value: answer_text.
Id Column
The ID column in the input file. Default value: qas_id.
Start Position Column
The column that contains the starting positions of answer spans in the input file. If the answer to a question can be found in the text passage, the starting position of the answer span is recorded in this column. Default value: start_position_character.
Output data file
The OSS path for the output answer file.
Use User-defined Model
Whether to use a custom model. Default value: no.
-
no
-
yes
OSS Directory for Alink Model
Required only if Use User-defined Model is set to yes.
The OSS path of the custom model.
Parameters Setting
batchSize
The number of samples processed at a time. In multi-server, multi-GPU training, this is the per-GPU batch size. The value must be of the INT type. Default value: 256.
Sequence Length
The maximum text passage length. The value must be of the INT type. Default value: 384.
Max Query Length
The maximum question length. The value must be of the INT type. Default value: 64.
Max Answer Length
The maximum answer length. The value must be of the INT type. Default value: 30.
Doc Stride
The sliding window stride for sliced text passages. The value must be of the INT type. Default value: 128.
pretrainModelNameOrPath
The name or path of a system-provided pre-trained model. Default value: hfl/macbert-base-zh.
-
User Defined
-
hfl/macbert-base-zh
-
hfl/macbert-large-zh
-
bert-base-uncased
-
bert-large-uncased
Additional Parameters
Custom parameters for fine-tuning the model.
Format:
{A: xxx, B: xxx}. Separate keys and values with colons (:). Separate multiple parameters with commas (,).Tuning
GPU Machine type
The GPU-accelerated instance type. The default value is gn5-c8g1.2xlarge, which provides 8 vCPUs, 80 GB of memory, and a single P100 GPU.
num_GPU_worker
The number of GPUs per worker. Default value: 1.
-
Example
The following figure shows a sample pipeline that uses this component.
To configure the component, perform the following steps:
-
Prepare a prediction dataset and upload the dataset to an OSS bucket. For more information, see the "Upload an object" section in the Get started by using the OSS console topic.
A dataset can be in the TSV or TEXT format and contains the following columns: ID column, text column, question column, answer column (optional), start position column (optional), and title column (optional).
In this example, a TSV file is used to show how to train a model.
-
Use the Read File Data -3 component to read the prediction dataset. Set the OSS Data Path parameter of the Read File Data component to the OSS path in which the prediction dataset is stored.
-
Connect the Read File Data-3 component to the machine reading comprehension predict component as an upstream node and configure the machine reading comprehension predict component. For more information, see the "Component parameters" section of this topic.
References
-
You can use this component together with the machine reading comprehension training component. For more information, see machine reading comprehension training.
-
For more information about Machine Learning Designer components, see Designer overview.
-
Machine Learning Designer provides various preset algorithm components that you can use based on your business scenario. For more information, see Designer component reference.