All Products
Search
Document Center

Platform For AI:Generate Chinese titles

Last Updated:Jun 20, 2026

Model Gallery provides a pre-trained model for generating Chinese titles. You can deploy this model directly or fine-tune it with your own dataset for custom scenarios. This topic shows you how to generate Chinese titles in Model Gallery.

Prerequisites

An OSS Bucket is required. For more information, see Create a bucket.

Step 1: Go to the model details page

  1. Go to the Model Gallery page.

    1. Log on to the PAI console.

    2. In the upper-left corner of the top navigation bar, select a region.

    3. In the left-side navigation pane, click Workspaces and then click the name of the workspace you want to open.

    4. In the left-side navigation pane, choose Quick Start > Model Gallery.

  2. On the Model Gallery page, search for EasyNLP_pai_mt5_title_generation_zh and click the model card to open its details page.

Step 2: Deploy and debug the model

Deploy the service

  1. On the model details page, click Deploy.

  2. On the model deployment page, confirm the details and click Deploy.

  3. In the Billing Notification dialog box, click OK.

    The page automatically redirects to the Service details page. You can view the service status in the Basic Information section. When the Status changes to Running, the service is deployed.

Debug the model online

Debug in the console

  1. On the Service details page, enter the request data in the Online Prediction text box. An example is shown below:

    {
        "data": ["At Guangzhou First People's Hospital, six patients underwent bronchoscopy in one morning. Five were diagnosed with lung cancer, and four of them were long-term smokers. Experts state that smoking and secondhand smoke are the primary causes of lung cancer."]
    }
  2. Click Send Request.

    The response appears at the bottom of the page. The page also shows the HTTP request details, including the request URL (a service address that starts with quickstart-20240109-gskx), the Authorization header, and the request body in JSON format. Use this information to call the service with an API outside the console.

Debug using Python code

  1. View the call information for the service.

    1. On the Service details page, go to the Resource Information section and click View Call Information.

    2. In the Call Information dialog box, on the Public network address call tab, view and copy the Endpoint and Token.

  2. Use the following sample code to send a service request.

    import requests
    url = "<PredictionServiceEndpoint>"
    token = "<PredictionServiceAccessToken>"
    request_body = '{"data": ["At Guangzhou First People\'s Hospital, six patients underwent bronchoscopy in one morning. Five were diagnosed with lung cancer, and four of them were long-term smokers. Experts state that smoking and secondhand smoke are the primary causes of lung cancer."]}'
    request_body = request_body.encode('utf-8')
    headers = {"Authorization": token}
    resp = requests.post(url=url, headers=headers, data=request_body)
    print(resp.content.decode())
    print("status code:", resp.status_code)
    

    Set url and token to the Endpoint and Token that you saved locally in the preceding steps, respectively.

    The following result is returned:

    {"data":["Six patients diagnosed with lung cancer at Guangzhou First People's Hospital"],"is_generating":false,"duration":0.1982583999633789,"average_duration":1.1621181964874268}
    status code: 200

Step 3: Fine-tune the model

  1. (Optional) Prepare a dataset.

    Note

    If you want to use your own data to fine-tune the model, follow these steps to prepare a training dataset.

    1. Model Gallery provides a default training dataset. You can use the default dataset or prepare your own. The training data must be in the following format:

      {"text": "<text>", "summary": "summary"}
      {"text": "<text>", "summary": "summary"}
      {"text": "<text>", "summary": "summary"}
      ......
      {"text": "<text>", "summary": "summary"}
                
    2. Upload the prepared data to your OSS Bucket. For more information, see Upload an object.

  2. Submit a training job.

    1. Return to the model details page. For more information, see Step 1: Go to the model details page.

    2. In the Model Training section, set Job Configuration > Output Path to your OSS Bucket path and click Fine-tune. This example uses the default dataset to fine-tune the model.

      Note

      If you prepared a training dataset, follow the steps in Model deployment and training to update the dataset in the Model Training section, and then click Fine-tune.

      You are automatically redirected to the Task details page. The task status appears at the top of the page, progressing through: Creating → Initializing → Submitted → Running. You can click the Task log tab to view the running logs of the training job, which contain information such as environment variable configurations.

Step 4: Deploy and debug the tuned model

  1. The trained model is automatically registered in AI Assets - Model Management. You can view or deploy the fine-tuned model. For more information, see Register and manage models.

  2. To debug the model online, see Debug the model online.