模型:
这个模型是在GLUE数据集上经过微调的 intfloat/e5-large 版本。
Text Embeddings by Weakly-Supervised Contrastive Pre-training .Liang Wang, Nan Yang, Xiaolong Huang, Binxing Jiao, Linjun Yang, Daxin Jiang, Rangan Majumder, Furu Wei, arXiv 2022
可以使用 zero-shot-classification 流程加载该模型:
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="mjwong/e5-large-mnli")
然后可以使用此流程将序列分类为您指定的任何类名。
sequence_to_classify = "one day I will see the world" candidate_labels = ['travel', 'cooking', 'dancing'] classifier(sequence_to_classify, candidate_labels)
如果有多个候选标签可能正确,请传入 multi_class=True 分别计算每个类的概率:
candidate_labels = ['travel', 'cooking', 'dancing', 'exploration'] classifier(sequence_to_classify, candidate_labels, multi_class=True)
该模型使用MultiNLI的开发集和ANLI的测试集进行评估,评估指标为准确率。
| Datasets | mnli_dev_m | mnli_dev_mm | anli_test_r1 | anli_test_r2 | anli_test_r3 |
|---|---|---|---|---|---|
| 1235321 | 0.840 | 0.839 | 0.231 | 0.285 | 0.309 |
| 1236321 | 0.844 | 0.838 | 0.253 | 0.288 | 0.301 |
| 1237321 | 0.868 | 0.869 | 0.301 | 0.296 | 0.294 |
| 1238321 | 0.875 | 0.876 | 0.354 | 0.298 | 0.313 |
| 1239321 | 0.865 | 0.867 | 0.314 | 0.285 | 0.303 |
| 12310321 | 0.843 | 0.848 | 0.646 | 0.484 | 0.458 |
| 12311321 | 0.836 | 0.842 | 0.634 | 0.481 | 0.478 |
训练过程中使用了以下超参数: