Update README.md
Browse files
README.md
CHANGED
@@ -10,15 +10,15 @@ tags:
|
|
10 |
---
|
11 |
|
12 |
# Erlangshen-Albert-235M-UniMC-English
|
13 |
-
|
14 |
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
15 |
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
16 |
|
17 |
## 简介 Brief Introduction
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
|
23 |
## 模型分类 Model Taxonomy
|
24 |
|
@@ -28,62 +28,61 @@ The first open source Chinese CLIP, pre-training on 123M image-text pairs, the t
|
|
28 |
|
29 |
## 模型信息 Model Information
|
30 |
|
31 |
-
|
32 |
|
33 |
-
We
|
|
|
|
|
34 |
|
35 |
### 下游效果 Performance
|
36 |
|
37 |
**Zero-Shot Classification**
|
38 |
|
39 |
-
|
|
40 |
-
|
41 |
-
|
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
| model | dataset | Top1 | Top5 | Top10 |
|
46 |
-
| ---- | ---- | ---- | ---- | ---- |
|
47 |
-
| Taiyi-CLIP-RoBERTa-102M-ViT-L-Chinese | Flickr30k-CNA-test | 58.32% | 82.96% | 89.40% |
|
48 |
-
| Taiyi-CLIP-RoBERTa-102M-ViT-L-Chinese | COCO-CN-test | 55.27% | 81.10% | 90.78% |
|
49 |
-
| Taiyi-CLIP-RoBERTa-102M-ViT-L-Chinese | wukong50k | 64.95% | 91.77% | 96.28% |
|
50 |
|
51 |
## 使用 Usage
|
52 |
|
53 |
```python3
|
54 |
-
|
55 |
-
import
|
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 |
|
|
|
10 |
---
|
11 |
|
12 |
# Erlangshen-Albert-235M-UniMC-English
|
13 |
+
- Paper: [Zero-Shot Learners for Nature Language Understanding via a Unified Multiple Choice Perspective](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
14 |
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
15 |
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
16 |
|
17 |
## 简介 Brief Introduction
|
18 |
|
19 |
+
将自然语言理解任务转化为multiple choice任务,并且使用14个机器阅读理解数据进行预训练
|
20 |
|
21 |
+
Convert natural language understanding tasks into multiple choice tasks, and use 14 machine reading comprehension data for pre-training
|
22 |
|
23 |
## 模型分类 Model Taxonomy
|
24 |
|
|
|
28 |
|
29 |
## 模型信息 Model Information
|
30 |
|
31 |
+
我们为零样本学习者提出了一种与输入无关的新范式,从某种意义上说,它与任何格式兼容并适用于一系列语言任务,例如文本分类、常识推理、共指解析、情感分析。我们的方法将零样本学习转化为多项选择任务,避免常用的大型生成模型(如 FLAN)中的问题。它不仅增加了模型的泛化能力,而且显着减少了对参数的需求。我们证明了这种方法可以在通用语言基准上取得最先进的性能,并在自然语言推理和文本分类等任务上产生令人满意的结果。
|
32 |
|
33 |
+
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.
|
34 |
+
Our approach converts zero-shot learning into multiple choice tasks,
|
35 |
+
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.
|
36 |
|
37 |
### 下游效果 Performance
|
38 |
|
39 |
**Zero-Shot Classification**
|
40 |
|
41 |
+
| Model | T0 11B | GLaM 60B | FLAN 137B | PaLM 540B | UniMC 235M |
|
42 |
+
|---------|--------|----------|-----------|-----------|------------|
|
43 |
+
| ANLI R1 | 43.6 | 40.9 | 47.7 | 48.4 | 52 |
|
44 |
+
| ANLI R2 | 38.7 | 38.2 | 43.9 | 44.2 | 44.4 |
|
45 |
+
| ANLI R3 | 41.3 | 40.9 | 47 | 45.7 | 47.8 |
|
46 |
+
| CB | 70.1 | 33.9 | 64.1 | 51.8 | 75.7 |
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
## 使用 Usage
|
49 |
|
50 |
```python3
|
51 |
+
import argparse
|
52 |
+
from fengshen import UniMCPiplines
|
53 |
+
|
54 |
+
|
55 |
+
total_parser = argparse.ArgumentParser("TASK NAME")
|
56 |
+
total_parser = UniMCPiplines.piplines_args(total_parser)
|
57 |
+
args = total_parser.parse_args()
|
58 |
+
args.pretrained_model_path = 'IDEA-CCNL/Erlangshen-Albert-235M-UniMC-English'
|
59 |
+
|
60 |
+
train_data = []
|
61 |
+
dev_data = []
|
62 |
+
test_data = [
|
63 |
+
{"texta": "Linguistics is the scientific study of language, and involves an analysis of language form, language meaning, and language in context. The earliest activities in the documentation and description of language have been attributed to the 4th century BCE Indian grammarian Pāṇini, who wrote a formal description of the Sanskrit language in his Aṣṭādhyāyī .",
|
64 |
+
"textb": "",
|
65 |
+
"question": "Based on the paragraph",
|
66 |
+
"choice": [
|
67 |
+
"we can infer that Form and meaning are the only aspects of language linguistics is concerned with.",
|
68 |
+
"we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.",
|
69 |
+
"it is difficult for us to infer that Form and meaning are the only aspects of language linguistics is concerned with."
|
70 |
+
],
|
71 |
+
"answer": "we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.",
|
72 |
+
"label": 1,
|
73 |
+
"id": 0},
|
74 |
+
]
|
75 |
+
|
76 |
+
model = UniMCPiplines(args)
|
77 |
+
|
78 |
+
if args.train:
|
79 |
+
model.fit(train_data, dev_data)
|
80 |
+
result = model.predict(test_data)
|
81 |
+
for line in result[:20]:
|
82 |
+
print(line)
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
|
87 |
```
|
88 |
|