suolyer commited on
Commit
f294d4e
1 Parent(s): 4875e62

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -32
README.md CHANGED
@@ -9,9 +9,9 @@ tags:
9
  - zero-shot
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
@@ -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
- args.pretrained_model_path = 'IDEA-CCNL/Erlangshen-Albert-235M-UniMC-English'
60
- args.language=='english'
61
-
62
- train_data = []
63
- dev_data = []
64
- test_data = [
65
- {"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ī .",
66
- "textb": "",
67
- "question": "Based on the paragraph",
68
- "choice": [
69
- "we can infer that Form and meaning are the only aspects of language linguistics is concerned with.",
70
- "we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.",
71
- "it is difficult for us to infer that Form and meaning are the only aspects of language linguistics is concerned with."
72
- ],
73
- "answer": "we can not infer that Form and meaning are the only aspects of language linguistics is concerned with.",
74
- "label": 1,
75
- "id": 0},
76
- ]
77
-
78
- model = UniMCPiplines(args)
79
 
80
  if args.train:
81
- model.fit(train_data, dev_data)
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