All Products
Search
Document Center

Platform For AI:Generate titles for Chinese text

Last Updated:Mar 11, 2026

Model Gallery provides a pre-trained model for Chinese title generation that deploy directly. For custom scenarios, also use your own dataset to fine-tune the model. This topic describes how to generate Chinese titles in Model Gallery.

Prerequisites

Create an OSS bucket. For more information, see Create a bucket in the console.

1. Go to the model details page

  1. Go to the Model Gallery page.

    1. Log on to the PAI console.

    2. In the left-side navigation pane, click Workspaces. On the Workspaces page, find the workspace that you want to manage and click the name of the workspace. The Workspace Details page appears.

    3. In the left-side navigation pane of the Workspace Details page, click Model Gallery.

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

2. Deploy and test the model

Deploy the model service

  1. On the model details page, click Model Deployment.

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

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

    The page automatically navigates to the Service Details page. view the service status in the Basic Information section. The service is deployed when the Status changes to Running.

Test the model online

Performing online debugging using the console

  1. On the Service Details page, enter the request data in the Online Prediction text box. The following is an example.

    {
        "data": ["In Guangzhou First People's Hospital, 6 patients underwent bronchoscopy in one morning. 5 were diagnosed with lung cancer, and 4 were long-term smokers. Experts say that smoking and secondhand smoke are the main causes of lung cancer."]
    }

    image

  2. Click Send Request.

    The output is displayed at the bottom of the page.image

Test online using Python code

  1. view service invocation information.

    1. On the Service Details page, in the Resource Information section, click View Endpoint Information.

      image

    2. In the View Endpoint Information dialog box, on the Shared Gateway - Internet Endpoint tab, 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": ["In Guangzhou First People\'s Hospital, 6 patients underwent bronchoscopy in one morning. 5 were diagnosed with lung cancer, and 4 were long-term smokers. Experts say that smoking and secondhand smoke are the main 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 copied in the previous step.

    The system returns the following result.image..png

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 training dataset. use the default dataset or prepare your own data. The data format is as follows:

      {"text": "<text>", "summary": "summary"}
      {"text": "<text>", "summary": "summary"}
      {"text": "<text>", "summary": "summary"}
      ......
      {"text": "<text>", "summary": "summary"}
      
    2. Upload the prepared data to an OSS bucket. For more information, see Upload a file in the console.

  2. Submit a training job.

    1. Go back to the model details page. For more information, see 1. Go to the model details page.

    2. In the Model Training section, under Training Settings, set Output Path to an OSS bucket path, and then click Train. This example uses the default dataset to fine-tune the model.

      Note

      If you have prepared your own training dataset, in the Model Training area, update the dataset by following the instructions in Train a model, and then click Train.

      The page automatically navigates to the Task Details page. click Task Logs to view the training process.image.png

4. Deploy and test the fine-tuned model

  1. The trained model is automatically registered in AI Asset - Model Management. then view or deploy the model from there. For more information, see Register and manage models.

  2. Test the model online. For more information, see Test the model online.