File size: 4,121 Bytes
18bd77f
cad4ca1
 
 
18bd77f
cad4ca1
 
 
 
8c0e056
cad4ca1
18bd77f
cad4ca1
 
 
d4e4ec5
cad4ca1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8f6d26
cad4ca1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e074f74
cad4ca1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
language: 
  - zh

license: apache-2.0

tags:
  - classification

inference: false

---

# Erlangshen-MacBERT-325M-TextMatch-Chinese

- Main Page:[Fengshenbang](https://fengshenbang-lm.com/)
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)

## 简介 Brief Introduction

3.25亿参数的MacBERT,在句子匹配任务上进行预训练,并在FewCLUE的BUSTM任务上微调。

The MacBERT with 325M parameters is pre-trained for Chinese text-matching tasks, and finetuned on task BUSTM from FewCLUE.

## 模型分类 Model Taxonomy

|  需求 Demand  | 任务 Task       | 系列 Series      | 模型 Model    | 参数 Parameter | 额外 Extra |
|  :----:  | :----:  | :----:  | :----:  | :----:  | :----:  |
| 通用 General  | 自然语言理解 NLU | 二郎神 Erlangshen | MacBERT      |      325M     |   Chinese     |

## 模型信息 Model Information


为了提高模型在句子匹配上的效果,我们收集了大量句子匹配数据进行预训练,随后在FewCLUE的BUSTM任务进行微调,所有的训练均基于我们提出的UniMC框架。最终结果表明,3.25亿参数的模型通过我们的训练策略可以在句子匹配任务上超过1.3亿参数的大模型。

To improve the model performance on the text-matching task, we collected numerous text-matching datasets for pre-training. Then the model was finetuned on a specific text-matching task, BUSTM from FewCLUE. All the training is based on the UniMC framework we proposed. The results show that our model with 325M parameters could surpass the model with 1.3B parameters on the text-matching task via our training strategies.

### 下游效果 Performance

BUSTM任务上的效果:

The results on BUSTM:

| Model                                         | BUSTM  | 
| --------------------------------------------- | ------ | 
| Erlangshen-UniMC-MegatronBERT-1.3B-Chinese    | 80.9  |
| **Erlangshen-MacBERT-325M-TextMatch-Chinese** | 81.6  | 

## 使用 Usage
```shell
git clone https://github.com/IDEA-CCNL/Fengshenbang-LM.git
cd Fengshenbang-LM
pip install --editable .
```

```python3
import argparse
from fengshen.pipelines.multiplechoice import UniMCPipelines
total_parser = argparse.ArgumentParser("TASK NAME")
total_parser = UniMCPipelines.piplines_args(total_parser)
args = total_parser.parse_args()
model_path='IDEA-CCNL/Erlangshen-MacBERT-325M-TextMatch-Chinese'
args.learning_rate=2e-5
args.max_length=512
args.max_epochs=3
args.batchsize=8
args.default_root_dir='./'
model = UniMCPipelines(args,model_path)
train_data = []
dev_data = []
test_data = [
        {"task_type":"语义匹配",
         "texta": "你晚上吃了什么", 
         "textb": "你晚上吃啥了", 
         "question": "怎么理解这段话?",  
         "label": 1, 
         "id": 1}
    ]
if args.train:
    model.train(train_data, dev_data)
result = model.predict(test_data)
for line in result[:20]:
    print(line)
```

## 引用 Citation

如果您在您的工作中使用了我们的模型,可以引用我们的[论文](https://arxiv.org/abs/2209.02970):

If you are using the resource for your work, please cite the our [paper](https://arxiv.org/abs/2209.02970):

```text
@article{fengshenbang,
  author    = {Jiaxing Zhang and Ruyi Gan and Junjie Wang and Yuxiang Zhang and Lin Zhang and Ping Yang and Xinyu Gao and Ziwei Wu and Xiaoqun Dong and Junqing He and Jianheng Zhuo and Qi Yang and Yongfeng Huang and Xiayu Li and Yanghan Wu and Junyu Lu and Xinyu Zhu and Weifeng Chen and Ting Han and Kunhao Pan and Rui Wang and Hao Wang and Xiaojun Wu and Zhongshen Zeng and Chongpei Chen},
  title     = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
  journal   = {CoRR},
  volume    = {abs/2209.02970},
  year      = {2022}
}
```

也可以引用我们的[网站](https://github.com/IDEA-CCNL/Fengshenbang-LM/):

You can also cite our [website](https://github.com/IDEA-CCNL/Fengshenbang-LM/):

```text
@misc{Fengshenbang-LM,
  title={Fengshenbang-LM},
  author={IDEA-CCNL},
  year={2021},
  howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
}
```