All Products
Search
Document Center

Platform For AI:Text summarization predict

Last Updated:Apr 01, 2026

Run batch predictions on your test data using a trained text summarization model and evaluate the results.

Prerequisites

Before you begin, ensure that you have:

Limitations

Only DLC compute resources are supported.

Configure the component

In Designer, add the Text Summarization Predict component to your workflow and configure the following parameters.

Input ports

The component has two input ports (left to right):

PortData typeRecommended upstream componentRequired
Prediction dataOSSRead OSS DataYes
Prediction modelComponent outputText Summarization TrainNo

Field settings

ParameterDefaultDescription
Input data formattarget:str:1,source:str:1Column schema of the input file.
Source text columnsourceColumn in the input table that contains the source text to summarize.
Appended output columnssourceInput columns to append to the output. Separate multiple column names with a comma (,).
Output columnspredictions,beamsColumns written to the output file. predictions contains the top summary; beams contains all beam search candidates.
Prediction data outputOSS bucket path where the output file is saved.
Use custom modelNoWhether to use the default PAI model for direct prediction. Set to Yes to use a custom model stored in OSS.
Is Megatron modelNoSet to Yes only when using a pre-trained model with the mg prefix listed in the Text Summarization Train component.
Model pathOSS path of the custom model. Required when Use custom model is set to Yes.

Parameter settings

ParameterTypeDefaultDescription
Batch sizeINT8Number of samples processed per step. For multi-GPU servers, this is the per-GPU batch size.
Maximum text lengthINT512Maximum sequence length of the input. Valid range: 1–512.
LanguageLanguage for text processing: zh for Chinese, en for English.
Copy text from sourcefalseWhether to use the copy mechanism, which allows the model to copy tokens directly from the source text.
Minimum decoder lengthINT12Minimum output length. The model generates summaries longer than this value.
Maximum decoder lengthINT32Maximum output length. The model generates summaries shorter than this value.
Minimal Unique FieldINT2Minimum n-gram size for the no-repeat constraint. Prevents repeated n-grams in the output.
Beam search sizeINT5Number of beams for beam search. Must match Number of returned candidates.
Number of returned candidatesINT5Number of candidate summaries to include in the output. Must match Beam search size.
Important

Beam search size and Number of returned candidates must be set to the same value.

Execution Tuning

ParameterDefaultDescription
GPU typegn5-c8g1.2xlargeGPU instance type for the compute resource.

Choose a model source

The component supports three model sources. Choose based on your situation:

Model sourceWhen to useHow to configure
Fine-tuned model from Text Summarization TrainYour model was trained in the same workflow using the Text Summarization Train component. This is the fastest way to start — no additional paths or flags required.Leave Use custom model set to No. Connect the model output port of the Text Summarization Train component to the model input port of this component.
Custom model (non-Megatron)You have a model stored in OSS that was trained or converted outside the current workflow. Use this when you need full control over the model checkpoint.Set Use custom model to Yes, leave Is Megatron model as No, and set Model path to the OSS path of the model.
Custom Megatron modelYour model uses the NVIDIA Megatron-LM framework and has the mg prefix.Set Use custom model to Yes and Is Megatron model to Yes. Set Model path to the OSS path of the model.

Run a prediction

This section shows how to build a complete prediction workflow using a fine-tuned model (Method 1) or a custom model (Method 2).

Method 1: workflow using a fine-tuned model from Text Summarization TrainMethod 2: workflow using a custom model
  1. Build the upstream workflow. For details, see the Example section in the Text Summarization Train topic.

  2. Prepare your test dataset (predict_data.txt) and upload it to an OSS bucket. The example uses a tab-delimited TXT file. CSV files are also supported. To upload the dataset to MaxCompute instead, use the Tunnel command of the MaxCompute client. For setup instructions, see Connect to MaxCompute using the client (odpscmd). For Tunnel command syntax, see Tunnel commands.

  3. Add a Read OSS Data component to read the test dataset: Set OSS Data Path to the OSS path where the test dataset is stored.

    • Method 1: Use the Read OSS Data-3 component.

    • Method 2: Use the Read OSS Data-1 component.

  4. Connect the model and test dataset to the Text Summarization Predict component, then configure its parameters:

    • Method 1 (fine-tuned model): Connect the model output port of the Text Summarization Train component to the model input port of the Text Summarization Predict component.

    • Method 2 (custom model): On the Field Settings tab, set Use custom model to Yes and set Model path to the OSS path of your model.

  5. Click image.png to run the workflow. After the job completes, the output file is saved to the OSS path specified in Prediction data output. The output file contains two columns:

    ColumnContent
    predictionsThe top-ranked summary for each input row.
    beamsAll beam search candidates for each input row.

What's next