Randolphzeng
commited on
Commit
•
f741a32
1
Parent(s):
99de12a
Update README.md
Browse files
README.md
CHANGED
@@ -1,8 +1,94 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
language:
|
4 |
-
- zh
|
5 |
tags:
|
6 |
- VAE
|
7 |
-
|
|
|
8 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: zh
|
|
|
|
|
3 |
tags:
|
4 |
- VAE
|
5 |
+
- Generation
|
6 |
+
inference: False
|
7 |
---
|
8 |
+
|
9 |
+
# Randeng-DELLA-226M-Chinese
|
10 |
+
|
11 |
+
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
12 |
+
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
13 |
+
|
14 |
+
## 简介 Brief Introduction
|
15 |
+
|
16 |
+
在悟道数据集上进行通用预训练的Deep VAE模型。其中编码器和解码器都是GPT-2架构。可以用于下游的句子重写,语义转换,性质控制等任务。
|
17 |
+
|
18 |
+
A deep VAE model pretrained on Wudao dataset. Both encoder and decoder are based on GPT-2 architecture. Such model is particularly suitable for paraphrasing, semantic updating and fine-grained attributes control.
|
19 |
+
|
20 |
+
## 模型分类 Model Taxonomy
|
21 |
+
|
22 |
+
| 需求 Demand | 任务 Task | 系列 Series | 模型 Model | 参数 Parameter | 额外 Extra |
|
23 |
+
| :----: | :----: | :----: | :----: | :----: | :----: |
|
24 |
+
| 通用 General | 自然语言生成 NLG | 燃灯 Randeng | DELLA | 226M | 变分自编码器-中文 VAE-Chinese |
|
25 |
+
|
26 |
+
|
27 |
+
## 模型信息 Model Information
|
28 |
+
|
29 |
+
参考论文:[Fuse It More Deeply! A Variational Transformer with Layer-Wise Latent Variable Inference for Text Generation](https://arxiv.org/abs/2207.06130)
|
30 |
+
|
31 |
+
基于[Randeng-Pegasus-523M-Chinese](https://huggingface.co/IDEA-CCNL/Randeng-Pegasus-523M-Chinese),我们在收集的7个中文领域的文本摘要数据集(约4M个样本)上微调了它,得到了summary版本。这7个数据集为:education, new2016zh, nlpcc, shence, sohu, thucnews和weibo。
|
32 |
+
|
33 |
+
Based on [Randeng-Pegasus-523M-Chinese](https://huggingface.co/IDEA-CCNL/Randeng-Pegasus-523M-Chinese), we fine-tuned a text summarization version (summary) on 7 Chinese text summarization datasets, with totaling around 4M samples. The datasets include: education, new2016zh, nlpcc, shence, sohu, thucnews and weibo.
|
34 |
+
|
35 |
+
### 下游效果 Performance
|
36 |
+
|
37 |
+
| datasets | rouge-1 | rouge-2 | rouge-L |
|
38 |
+
| ---- | ---- | ---- | ---- |
|
39 |
+
| LCSTS | 48.00 | 35.24 | 44.70 |
|
40 |
+
|
41 |
+
## 使用 Usage
|
42 |
+
|
43 |
+
```python
|
44 |
+
|
45 |
+
from transformers import PegasusForConditionalGeneration
|
46 |
+
# Need to download tokenizers_pegasus.py and other Python script from Fengshenbang-LM github repo in advance,
|
47 |
+
# or you can download tokenizers_pegasus.py and data_utils.py in https://huggingface.co/IDEA-CCNL/Randeng_Pegasus_523M/tree/main
|
48 |
+
# Strongly recommend you git clone the Fengshenbang-LM repo:
|
49 |
+
# 1. git clone https://github.com/IDEA-CCNL/Fengshenbang-LM
|
50 |
+
# 2. cd Fengshenbang-LM/fengshen/examples/pegasus/
|
51 |
+
# and then you will see the tokenizers_pegasus.py and data_utils.py which are needed by pegasus model
|
52 |
+
from tokenizers_pegasus import PegasusTokenizer
|
53 |
+
|
54 |
+
model = PegasusForConditionalGeneration.from_pretrained("IDEA-CCNL/Randeng-Pegasus-523M-Summary-Chinese")
|
55 |
+
tokenizer = PegasusTokenizer.from_pretrained("IDEA-CCNL/Randeng-Pegasus-523M-Summary-Chinese")
|
56 |
+
|
57 |
+
text = "据微信公众号“界面”报道,4日上午10点左右,中国发改委反垄断调查小组突击查访奔驰上海办事处,调取数据材料,并对多名奔驰高管进行了约谈。截止昨日晚9点,包括北京梅赛德斯-奔驰销售服务有限公司东区总经理在内的多名管理人员仍留在上海办公室内"
|
58 |
+
inputs = tokenizer(text, max_length=1024, return_tensors="pt")
|
59 |
+
|
60 |
+
# Generate Summary
|
61 |
+
summary_ids = model.generate(inputs["input_ids"])
|
62 |
+
tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
63 |
+
|
64 |
+
# model Output: 反垄断调查小组突击查访奔驰上海办事处,对多名奔驰高管进行约谈
|
65 |
+
```
|
66 |
+
|
67 |
+
## 引用 Citation
|
68 |
+
|
69 |
+
如果您在您的工作中使用了我们的模型,可以引用我们的[论文](https://arxiv.org/abs/2209.02970):
|
70 |
+
|
71 |
+
If you are using the resource for your work, please cite the our [paper](https://arxiv.org/abs/2209.02970):
|
72 |
+
|
73 |
+
```text
|
74 |
+
@article{fengshenbang,
|
75 |
+
author = {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 and Ruyi Gan and Jiaxing Zhang},
|
76 |
+
title = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
|
77 |
+
journal = {CoRR},
|
78 |
+
volume = {abs/2209.02970},
|
79 |
+
year = {2022}
|
80 |
+
}
|
81 |
+
```
|
82 |
+
|
83 |
+
也可以引用我们的[网站](https://github.com/IDEA-CCNL/Fengshenbang-LM/):
|
84 |
+
|
85 |
+
You can also cite our [website](https://github.com/IDEA-CCNL/Fengshenbang-LM/):
|
86 |
+
|
87 |
+
```text
|
88 |
+
@misc{Fengshenbang-LM,
|
89 |
+
title={Fengshenbang-LM},
|
90 |
+
author={IDEA-CCNL},
|
91 |
+
year={2021},
|
92 |
+
howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
|
93 |
+
}
|
94 |
+
```
|