suolyer commited on
Commit
3318545
·
1 Parent(s): 7f6fef8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +132 -0
README.md CHANGED
@@ -1,3 +1,135 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ # inference: false
4
+
5
+ # inference:
6
+ # parameters:
7
+ tags:
8
+ - classification
9
+ - zero-shot
10
  ---
11
+
12
+ # Erlangshen-UniMC-DeBERTa-v2-330M-Chinese
13
+
14
+ - Paper: [Zero-Shot Learners for Natural Language Understanding via a Unified Multiple Choice Perspective](https://arxiv.org/abs/2210.08590)
15
+ - Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/unimc/)
16
+ - Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
17
+
18
+ ## 简介 Brief Introduction
19
+
20
+ 将自然语言理解任务转化为multiple choice任务,并且使用 48 个 NLU 任务进行预训练
21
+
22
+ Convert natural language understanding tasks into multiple choice tasks, and use 48 NLU task for pre-training
23
+
24
+ ## 模型分类 Model Taxonomy
25
+
26
+ | 需求 Demand | 任务 Task | 系列 Series | 模型 Model | 参数 Parameter | 额外 Extra |
27
+ | :----: | :----: | :----: | :----: | :----: | :----: |
28
+ | 通用 General | 自然语言理解 NLU | 二郎神 Erlangshen | DeBERTa-v2 | 330M | Chinese |
29
+
30
+ ## 模型信息 Model Information
31
+
32
+ 我们为零样本学习者提出了一种与输入无关的新范式,从某种意义上说,它与任何格式兼容并适用于一系列语言任务,例如文本分类、常识推理、共指解析、情感分析。我们的方法将零样本学习转化为多项选择任务,避免常用的大型生成模型(如 FLAN)中的问题。它不仅增加了模型的泛化能力,而且显着减少了对参数的需求。我们证明了这种方法可以在通用语言基准上取得最先进的性能,并在自然语言推理和文本分类等任务上产生令人满意的结果。更多详细信息可以参考我们的[论文](https://arxiv.org/abs/2210.08590)或者[GitHub](https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/unimc/)
33
+
34
+ We propose an new paradigm for zero-shot learners that is input-agnostic, in the sense that it is compatible with any format and applicable to a list of language tasks, such as text classification, commonsense reasoning, coreference resolution, sentiment analysis.
35
+ Our approach converts zero-shot learning into multiple choice tasks,
36
+ avoiding problems in commonly used large generative models such as FLAN. It not only adds generalization ability to the models, but also reduces the needs of parameters significantly. We demonstrate that this approach leads to state-of-the-art performance on common language benchmarks, and produces satisfactory results on tasks such as natural language inference and text classification. For more details, please refer to our [paper](https://arxiv.org/abs/2210.08590) or [github](https://github.com/IDEA-CCNL/Fengshenbang-LM/tree/main/fengshen/examples/unimc/)
37
+
38
+ ### 下游效果 Performance
39
+
40
+
41
+ | Model | afqmc | tnews | iflytek | ocnli |
42
+ |------------|------------|----------|-----------|----------|
43
+ | roberta-base | 74.06 | 57.5 | 60.36 | 74.3 |
44
+ | roberta-large | 74.88 | 58.79 | 61.52 | 77.77 |
45
+ | [Erlangshen-UniMC-DeBERTa-v2-110M-Chinese](https://huggingface.co/IDEA-CCNL/Erlangshen-UniMC-DeBERTa-v2-110M-Chinese/) | 74.49 | 57.28 | 61.42 | 76.98 |
46
+ | [Erlangshen-UniMC-DeBERTa-v2-330M-Chinese](https://huggingface.co/IDEA-CCNL/Erlangshen-UniMC-DeBERTa-v2-330M-Chinese/) | **76.16** | 58.61 | - | **81.86** |
47
+
48
+
49
+
50
+ ## 使用 Usage
51
+ ```shell
52
+ git clone https://github.com/IDEA-CCNL/Fengshenbang-LM.git
53
+ cd Fengshenbang-LM
54
+ pip install --editable .
55
+ ```
56
+
57
+
58
+ ```python3
59
+ import argparse
60
+ from fengshen.pipelines.multiplechoice import UniMCPiplines
61
+
62
+
63
+ total_parser = argparse.ArgumentParser("TASK NAME")
64
+ total_parser = UniMCPiplines.piplines_args(total_parser)
65
+ args = total_parser.parse_args()
66
+ args.pretrained_model_path = 'IDEA-CCNL/Erlangshen-UniMC-DeBERTa-v2-330M-Chinese'
67
+ args.learning_rate=2e-5
68
+ args.max_length=512
69
+ args.max_epochs=3
70
+ args.batchsize=8
71
+ args.default_root_dir='./'
72
+ model = UniMCPiplines(args)
73
+
74
+ train_data = []
75
+ dev_data = []
76
+ test_data = [
77
+ {"texta": "放弃了途观L和荣威RX5,果断入手这部车,外观霸气又好开",
78
+ "textb": "",
79
+ "question": "下面新闻属于哪一个类别?",
80
+ "choice": [
81
+ "房产",
82
+ "汽车",
83
+ "教育",
84
+ "科技"
85
+ ],
86
+ "answer": "汽车",
87
+ "label": 1,
88
+ "id": 7759}
89
+ ]
90
+
91
+ if args.train:
92
+ model.train(train_data, dev_data)
93
+ result = model.predict(test_data)
94
+ for line in result[:20]:
95
+ print(line)
96
+
97
+
98
+ ```
99
+
100
+ ## 引用 Citation
101
+
102
+ 如果您在您的工作中使用了我们的模型,可以引用我们的[论文](https://arxiv.org/abs/2210.08590):
103
+
104
+ If you are using the resource for your work, please cite the our [paper](https://arxiv.org/abs/2210.08590):
105
+
106
+ ```text
107
+ @article{unimc,
108
+ author = {Ping Yang and
109
+ Junjie Wang and
110
+ Ruyi Gan and
111
+ Xinyu Zhu and
112
+ Lin Zhang and
113
+ Ziwei Wu and
114
+ Xinyu Gao and
115
+ Jiaxing Zhang and
116
+ Tetsuya Sakai},
117
+ title = {Zero-Shot Learners for Natural Language Understanding via a Unified Multiple Choice Perspective},
118
+ journal = {CoRR},
119
+ volume = {abs/2210.08590},
120
+ year = {2022}
121
+ }
122
+ ```
123
+
124
+ 也可以引用我们的[网站](https://github.com/IDEA-CCNL/Fengshenbang-LM/):
125
+
126
+ You can also cite our [website](https://github.com/IDEA-CCNL/Fengshenbang-LM/):
127
+
128
+ ```text
129
+ @misc{Fengshenbang-LM,
130
+ title={Fengshenbang-LM},
131
+ author={IDEA-CCNL},
132
+ year={2021},
133
+ howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
134
+ }
135
+ ```