🚀 二郎神-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}},
}