Update README.md
Browse files
README.md
CHANGED
@@ -9,9 +9,9 @@ tags:
|
|
9 |
- zero-shot
|
10 |
---
|
11 |
|
12 |
-
# Erlangshen-Albert-235M-
|
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
|
@@ -49,43 +49,36 @@ avoiding problems in commonly used large generative models such as FLAN. It not
|
|
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 |
-
|
59 |
-
|
60 |
-
args.language
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
|
80 |
if args.train:
|
81 |
-
|
82 |
result = model.predict(test_data)
|
83 |
-
for line in result[:20]:
|
84 |
-
print(line)
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
```
|
90 |
|
91 |
## 引用 Citation
|
|
|
9 |
- zero-shot
|
10 |
---
|
11 |
|
12 |
+
# Erlangshen-UniMC-Albert-235M-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/tree/main/fengshen/examples/unimc/)
|
15 |
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
16 |
|
17 |
## 简介 Brief Introduction
|
|
|
49 |
|
50 |
```python3
|
51 |
import argparse
|
52 |
+
from fengshen.pipelines.multiplechoice import UniMCPiplines
|
|
|
53 |
|
54 |
total_parser = argparse.ArgumentParser("TASK NAME")
|
55 |
total_parser = UniMCPiplines.piplines_args(total_parser)
|
56 |
args = total_parser.parse_args()
|
57 |
+
|
58 |
+
pretrained_model_path = 'IDEA-CCNL/Erlangshen-UniMC-Albert-235M-English'
|
59 |
+
args.language='english'
|
60 |
+
args.learning_rate=2e-5
|
61 |
+
args.max_length=512
|
62 |
+
args.max_epochs=3
|
63 |
+
args.batchsize=8
|
64 |
+
args.default_root_dir='./'
|
65 |
+
model = UniMCPiplines(args, model_path=pretrained_model_path)
|
66 |
+
|
67 |
+
train_data = []
|
68 |
+
dev_data = []
|
69 |
+
test_data = [{
|
70 |
+
"texta": "it 's just incredibly dull .",
|
71 |
+
"textb": "",
|
72 |
+
"question": "What is sentiment of follow review?",
|
73 |
+
"choice": ["it's great", "it's terrible"],
|
74 |
+
"answer": "",
|
75 |
+
"label": 0,
|
76 |
+
"id": 19
|
77 |
+
}]
|
78 |
|
79 |
if args.train:
|
80 |
+
model.fit(train_data, dev_data)
|
81 |
result = model.predict(test_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
```
|
83 |
|
84 |
## 引用 Citation
|