init commit
Browse files
README.md
CHANGED
@@ -8,11 +8,11 @@ tags:
|
|
8 |
- sentencepiece
|
9 |
inference: true
|
10 |
widget:
|
11 |
-
- text: "
|
12 |
- type: "text-generation"
|
13 |
---
|
14 |
|
15 |
-
# Randeng-T5-
|
16 |
|
17 |
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
18 |
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
@@ -62,7 +62,7 @@ model.resize_token_embeddings(len(tokenizer))
|
|
62 |
model.eval()
|
63 |
|
64 |
# tokenize
|
65 |
-
text = "
|
66 |
encode_dict = tokenizer(text, max_length=512, padding='max_length',truncation=True)
|
67 |
|
68 |
inputs = {
|
@@ -74,15 +74,14 @@ inputs = {
|
|
74 |
logits = model.generate(
|
75 |
input_ids = inputs['input_ids'],
|
76 |
max_length=100,
|
77 |
-
|
78 |
-
# early_stopping=True,
|
79 |
)
|
80 |
|
81 |
logits=logits[:,1:]
|
82 |
predict_label = [tokenizer.decode(i,skip_special_tokens=True) for i in logits]
|
83 |
print(predict_label)
|
84 |
|
85 |
-
# model output:
|
86 |
```
|
87 |
|
88 |
## 引用 Citation
|
|
|
8 |
- sentencepiece
|
9 |
inference: true
|
10 |
widget:
|
11 |
+
- text: "情感分析任务:【房间还是比较舒适的,酒店服务良好】这篇文章的情感态度是什么?正面/负面"
|
12 |
- type: "text-generation"
|
13 |
---
|
14 |
|
15 |
+
# Randeng-T5-77M-MultiTask-Chinese
|
16 |
|
17 |
- Github: [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM)
|
18 |
- Docs: [Fengshenbang-Docs](https://fengshenbang-doc.readthedocs.io/)
|
|
|
62 |
model.eval()
|
63 |
|
64 |
# tokenize
|
65 |
+
text = "情感分析任务:【房间还是比较舒适的,酒店服务良好】这篇文章的情感态度是什么?正面/负面"
|
66 |
encode_dict = tokenizer(text, max_length=512, padding='max_length',truncation=True)
|
67 |
|
68 |
inputs = {
|
|
|
74 |
logits = model.generate(
|
75 |
input_ids = inputs['input_ids'],
|
76 |
max_length=100,
|
77 |
+
early_stopping=True,
|
|
|
78 |
)
|
79 |
|
80 |
logits=logits[:,1:]
|
81 |
predict_label = [tokenizer.decode(i,skip_special_tokens=True) for i in logits]
|
82 |
print(predict_label)
|
83 |
|
84 |
+
# model output: 正面
|
85 |
```
|
86 |
|
87 |
## 引用 Citation
|