Update README.md
Browse files
README.md
CHANGED
@@ -64,42 +64,7 @@ pip install --editable .
|
|
64 |
|
65 |
```python3
|
66 |
import argparse
|
67 |
-
from fengshen
|
68 |
-
|
69 |
-
|
70 |
-
total_parser = argparse.ArgumentParser("TASK NAME")
|
71 |
-
total_parser = UniEXPipelines.piplines_args(total_parser)
|
72 |
-
args = total_parser.parse_args()
|
73 |
-
pretrained_model_path = 'IDEA-CCNL/Erlangshen-UniEX-RoBERTa-110M-Chinese'
|
74 |
-
args.learning_rate=2e-5
|
75 |
-
args.max_length=512
|
76 |
-
args.max_epochs=3
|
77 |
-
args.batchsize=8
|
78 |
-
args.default_root_dir='./'
|
79 |
-
model = UniEXPipelines(args, pretrained_model_path)
|
80 |
-
|
81 |
-
train_data = []
|
82 |
-
dev_data = []
|
83 |
-
test_data = [
|
84 |
-
{"texta": "放弃了途观L和荣威RX5,果断入手这部车,外观霸气又好开",
|
85 |
-
"textb": "",
|
86 |
-
"question": "下面新闻属于哪一个类别?",
|
87 |
-
"choice": [
|
88 |
-
"房产",
|
89 |
-
"汽车",
|
90 |
-
"教育",
|
91 |
-
"科技"
|
92 |
-
],
|
93 |
-
"answer": "汽车",
|
94 |
-
"label": 1,
|
95 |
-
"id": 7759}
|
96 |
-
]
|
97 |
-
|
98 |
-
if args.train:
|
99 |
-
model.train(train_data, dev_data)
|
100 |
-
result = model.predict(test_data)
|
101 |
-
for line in result[:20]:
|
102 |
-
print(line)
|
103 |
|
104 |
|
105 |
```
|
|
|
64 |
|
65 |
```python3
|
66 |
import argparse
|
67 |
+
from fengshen import ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
|
70 |
```
|