🚀 DistilBart - MNLI
DistilBart - MNLI是bart - large - mnli
的蒸馏版本,它采用了Huggingface为BART摘要任务提出的无教师蒸馏技术创建而成,具体可参考此处。该模型通过复制bart - large - mnli
的交替层,并在相同数据上进一步微调得到。
数据集和标签信息
属性 |
详情 |
数据集 |
mnli |
标签 |
distilbart、distilbart - mnli |
管道标签 |
zero - shot - classification |
模型性能对比
模型 |
匹配准确率 |
不匹配准确率 |
[bart - large - mnli](https://huggingface.co/facebook/bart - large - mnli) (基线模型, 12 - 12) |
89.9 |
90.01 |
[distilbart - mnli - 12 - 1](https://huggingface.co/valhalla/distilbart - mnli - 12 - 1) |
87.08 |
87.5 |
[distilbart - mnli - 12 - 3](https://huggingface.co/valhalla/distilbart - mnli - 12 - 3) |
88.1 |
88.19 |
[distilbart - mnli - 12 - 6](https://huggingface.co/valhalla/distilbart - mnli - 12 - 6) |
89.19 |
89.01 |
[distilbart - mnli - 12 - 9](https://huggingface.co/valhalla/distilbart - mnli - 12 - 9) |
89.56 |
89.52 |
可以看出,这种蒸馏技术非常简单且有效,模型性能下降很小。详细的性能权衡信息可查看此表格。
📦 安装指南
如果你想自己训练这些模型,可克隆[distillbart - mnli仓库](https://github.com/patil - suraj/distillbart - mnli),并按照以下步骤操作:
- 从源代码克隆并安装transformers库
git clone https://github.com/huggingface/transformers.git
pip install -qqq -U ./transformers
- 下载MNLI数据
python transformers/utils/download_glue_data.py --data_dir glue_data --tasks MNLI
💻 使用示例
基础用法
创建学生模型
python create_student.py \
--teacher_model_name_or_path facebook/bart-large-mnli \
--student_encoder_layers 12 \
--student_decoder_layers 6 \
--save_path student-bart-mnli-12-6 \
高级用法
开始微调
python run_glue.py args.json
训练模型的日志可在[此wandb项目](https://wandb.ai/psuraj/distilbart - mnli)中查看。