Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,51 @@
|
|
1 |
---
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- zh
|
4 |
license: apache-2.0
|
5 |
+
|
6 |
+
tags:
|
7 |
+
- bert
|
8 |
+
- NLU
|
9 |
+
- Sentiment
|
10 |
+
|
11 |
+
inference: true
|
12 |
+
|
13 |
+
widget:
|
14 |
+
- text: "今天心情不好"
|
15 |
+
|
16 |
---
|
17 |
+
# Erlangshen-MegatronBert-1.3B-Semtiment, model (Chinese),one model of [Fengshenbang-LM](https://github.com/IDEA-CCNL/Fengshenbang-LM).
|
18 |
+
We collect 8 sentiment datasets in the Chinese domain for finetune, with a total of 227347 samples. Our model is mainly based on [MegatronBert-1.3B](https://huggingface.co/IDEA-CCNL/Erlangshen-MegatronBert-1.3B)
|
19 |
+
|
20 |
+
## Usage
|
21 |
+
```python
|
22 |
+
from transformers import BertForSequenceClassification
|
23 |
+
from transformers import BertTokenizer
|
24 |
+
import torch
|
25 |
+
|
26 |
+
tokenizer=BertTokenizer.from_pretrained('IDEA-CCNL/Erlangshen-MegatronBert-1.3B-Sentiment')
|
27 |
+
model=BertForSequenceClassification.from_pretrained('IDEA-CCNL/Erlangshen-MegatronBert-1.3B-Sentiment')
|
28 |
+
|
29 |
+
text='今天心情不好'
|
30 |
+
|
31 |
+
output=model(torch.tensor([tokenizer.encode(text)]))
|
32 |
+
print(torch.nn.functional.softmax(output.logits,dim=-1))
|
33 |
+
|
34 |
+
```
|
35 |
+
## Scores on downstream chinese tasks
|
36 |
+
| Model | ASAP-SENT | ASAP-ASPECT | ChnSentiCorp |
|
37 |
+
| :--------: | :-----: | :----: | :-----: |
|
38 |
+
| Erlangshen-Roberta-110M-Sentiment | 97.77 | 97.31 | 96.61 |
|
39 |
+
| Erlangshen-Roberta-330M-Sentiment | 97.9 | 97.51 | 96.66 |
|
40 |
+
| Erlangshen-MegatronBert-1.3B-Sentiment | 98.1 | 97.8 | 97 |
|
41 |
+
|
42 |
+
## Citation
|
43 |
+
If you find the resource is useful, please cite the following website in your paper.
|
44 |
+
```
|
45 |
+
@misc{Fengshenbang-LM,
|
46 |
+
title={Fengshenbang-LM},
|
47 |
+
author={IDEA-CCNL},
|
48 |
+
year={2021},
|
49 |
+
howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
|
50 |
+
}
|
51 |
+
```
|