🚀 二郎神-RoBERTa-330M-NLI
二郎神-RoBERTa-330M-NLI 是中文的 RoBERTa-wwm-ext-large 在數個推理任務微調後的版本,可用於自然語言理解和自然語言推斷等任務。
🚀 快速開始
本模型基於 chinese-roberta-wwm-ext-large,在收集的 4 箇中文領域的 NLI(自然語言推理)數據集,總計 1014787 個樣本上進行了微調。以下是使用該模型的示例代碼:
from transformers import BertForSequenceClassification
from transformers import BertTokenizer
import torch
tokenizer=BertTokenizer.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-NLI')
model=BertForSequenceClassification.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-NLI')
texta='今天的飯不好吃'
textb='今天心情不好'
output=model(torch.tensor([tokenizer.encode(texta,textb)]))
print(torch.nn.functional.softmax(output.logits,dim=-1))
✨ 主要特性
- 基於中文 RoBERTa-wwm-ext-large 模型微調,適用於中文自然語言推斷任務。
- 在多箇中文 NLI 數據集上進行訓練,具有較好的下游任務表現。
📦 安裝指南
文檔未提供安裝步驟,可參考 transformers
庫的安裝方式,使用以下命令進行安裝:
pip install transformers
💻 使用示例
基礎用法
from transformers import BertForSequenceClassification
from transformers import BertTokenizer
import torch
tokenizer=BertTokenizer.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-NLI')
model=BertForSequenceClassification.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-NLI')
texta='今天的飯不好吃'
textb='今天心情不好'
output=model(torch.tensor([tokenizer.encode(texta,textb)]))
print(torch.nn.functional.softmax(output.logits,dim=-1))
📚 詳細文檔
模型分類
屬性 |
詳情 |
需求 |
通用 |
任務 |
自然語言理解 |
系列 |
二郎神 |
模型 |
Roberta |
參數 |
330M |
額外 |
中文 - 自然語言推斷 |
模型信息
基於 chinese-roberta-wwm-ext-large,我們在收集的 4 箇中文領域的 NLI(自然語言推理)數據集,總計 1014787 個樣本上微調了一個 NLI 版本。
下游效果
模型 |
cmnli |
ocnli |
snli |
Erlangshen-Roberta-110M-NLI |
80.83 |
78.56 |
88.01 |
Erlangshen-Roberta-330M-NLI |
82.25 |
79.82 |
88 |
Erlangshen-MegatronBert-1.3B-NLI |
84.52 |
84.17 |
88.67 |
📄 許可證
本項目採用 Apache-2.0 許可證。
📖 引用
如果您在您的工作中使用了我們的模型,可以引用我們的 論文:
@article{fengshenbang,
author = {Jiaxing Zhang and Ruyi Gan and Junjie Wang and Yuxiang Zhang and Lin Zhang and Ping Yang and Xinyu Gao and Ziwei Wu and Xiaoqun Dong and Junqing He and Jianheng Zhuo and Qi Yang and Yongfeng Huang and Xiayu Li and Yanghan Wu and Junyu Lu and Xinyu Zhu and Weifeng Chen and Ting Han and Kunhao Pan and Rui Wang and Hao Wang and Xiaojun Wu and Zhongshen Zeng and Chongpei Chen},
title = {Fengshenbang 1.0: Being the Foundation of Chinese Cognitive Intelligence},
journal = {CoRR},
volume = {abs/2209.02970},
year = {2022}
}
也可以引用我們的 網站:
@misc{Fengshenbang-LM,
title={Fengshenbang-LM},
author={IDEA-CCNL},
year={2021},
howpublished={\url{https://github.com/IDEA-CCNL/Fengshenbang-LM}},
}