---
title: mengzi-t5-base-mt
canonical_url: "https://www.modelscope.cn/models/langboat/mengzi-t5-base-mt"
md_url: "https://www.modelscope.cn/models/langboat/mengzi-t5-base-mt.md"
repository: langboat/mengzi-t5-base-mt
chinese_name: "孟子T5预训练生成模型-中文-base-多任务"
last_updated: 2022-12-16
license: "Apache License 2.0"
pipeline_tag: text2text-generation
tasks:
  - text2text-generation
model_type:
  - t5
architectures:
  - T5ForConditionalGeneration
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - zh
domain:
  - nlp
downloads: 25287
stars: 8
tags:
  - transformer
  - "澜舟科技"
  - Langboat
  - mengzi
---

# mengzi-t5-base-mt

> mengzi-t5-base-mt - langboat 在 ModelScope 开源的模型。孟子T5多任务模型在mengzi-t5-base的基础上，进一步使用27个数据集和301种prompt进行了多任务的混合训练。不仅可以实现“一个模型完成多个任务”，还具备极强的泛化能力，无需大量标注数据就可以完成新任务适配，在应用上能够让模型研发和部署维护更加轻量化。

langboat/mengzi-t5-base-mt 是 ModelScope 魔搭社区上的text2text-generation模型，采用 Apache License 2.0 许可。

- **Repository**: langboat/mengzi-t5-base-mt
- **License**: Apache License 2.0
- **Tasks**: text2text-generation
- **Tags**: transformer, 澜舟科技, Langboat, mengzi
- **Downloads**: 25287
- **Stars**: 8
- **Last updated**: 2022-12-16

Source: https://www.modelscope.cn/models/langboat/mengzi-t5-base-mt

---

# 孟子T5预训练生成模型-中文-base-多任务

孟子T5多任务模型在[mengzi-t5-base](https://modelscope.cn/models/langboat/mengzi-t5-base/summary)的基础上，进一步使用27个数据集和301种prompt进行了多任务的混合训练。

关于孟子T5预训练生成模型的更多信息可参考论文：[Mengzi: Towards Lightweight yet Ingenious Pre-trained Models for Chinese](https://arxiv.org/abs/2110.06696)

## 模型描述

孟子多任务模型提供出色的 Zero-Shot 及 Few-Shot 能力，以 0.22B 的轻量化模型在 ZeroCLUE 和 FewCLUE 榜单均排名第一。
不仅可以实现“一个模型完成多个任务”，还具备极强的泛化能力，无需大量标注数据就可以完成新任务适配，在应用上能够让模型研发和部署维护更加轻量化。

### clue榜单结果（2022-08-22）

#### ZeroCLUE
![img_1.png](images/img_1.png)

#### FewCLUE
![img_2.png](images/img_2.png)

### 实际场景验证

孟子多任务模型基于用户私有数据及各个领域（包括金融、医疗）的任务训练，在大量实际场景中得到验证。
下图展示了 Mengzi-T5-base-MT 模型在金融实体关系抽取任务的示例： 
![img_4.png](images/img_4.png)
### 更多模型能力展示
![img_3.png](images/img_3.png)

### 如何使用
```python
from modelscope.models import Model
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

pipeline_ins = pipeline(task=Tasks.text2text_generation, model='langboat/mengzi-t5-base-mt')
result = pipeline_ins(input='中国的首都位于<extra_id_0>。')
print (result)
#{'text': '北京'}


from modelscope.models.nlp import T5ForConditionalGeneration
from modelscope.preprocessors import TextGenerationTransformersPreprocessor
model = T5ForConditionalGeneration.from_pretrained('langboat/mengzi-t5-base-mt')
preprocessor = TextGenerationTransformersPreprocessor(model.model_dir)
pipeline_ins = pipeline(
    task=Tasks.text2text_generation,
    model=model,
    preprocessor=preprocessor)
print(pipeline_ins('中国的首都位于<extra_id_0>。'))
#{'text': '北京'}

```

## 相关论文以及引用信息
```
@misc{zhang2021mengzi,
      title={Mengzi: Towards Lightweight yet Ingenious Pre-trained Models for Chinese}, 
      author={Zhuosheng Zhang and Hanqing Zhang and Keming Chen and Yuhang Guo and Jingyun Hua and Yulong Wang and Ming Zhou},
      year={2021},
      eprint={2110.06696},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```
