🚀 xlm-roberta-large-manifesto
本项目的xlm-roberta-large
模型在使用Manifesto Project编码方案标注的多语言训练数据上进行了微调。它能有效应用于零样本分类和文本分类等任务。
🚀 快速开始
模型使用
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
model="poltextlab/xlm-roberta-large-manifesto",
task="text-classification",
tokenizer=tokenizer,
use_fast=False,
token="<your_hf_read_only_token>"
)
text = "We will place an immediate 6-month halt on the finance driven closure of beds and wards, and set up an independent audit of needs and facilities."
pipe(text)
受限访问说明
由于该模型采用受限访问机制,在加载模型时必须传递token
参数。在早期版本的Transformers包中,可能需要使用use_auth_token
参数代替。
✨ 主要特性
- 多语言支持:支持多种语言的文本分类任务,可处理不同语言的输入。
- 基于特定编码方案:使用Manifesto Project的编码方案进行标注训练,具有特定领域的适用性。
💻 使用示例
基础用法
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
model="poltextlab/xlm-roberta-large-manifesto",
task="text-classification",
tokenizer=tokenizer,
use_fast=False,
token="<your_hf_read_only_token>"
)
text = "We will place an immediate 6-month halt on the finance driven closure of beds and wards, and set up an independent audit of needs and facilities."
pipe(text)
📚 详细文档
模型描述
本模型是在多语言训练数据上微调的xlm-roberta-large
模型,使用了Manifesto Project的编码方案进行标注。具体使用了 Version 2020b (December 23, 2020) 版本的Manifesto Project数据集代码手册。
模型性能
模型在305141个示例的测试集上进行了评估,测试集采用分层方式划分,对于每个标签,随机选择所有出现次数的20%。
属性 |
详情 |
评估指标 |
指标(精确率、召回率和F1分数为加权宏平均值) |
具体指标 |
精确率:0.6495;召回率:0.6547;F1分数:0.6507;准确率:0.6547;Top3准确率:0.8505;Top5准确率:0.9073 |
语言特定指标:

调试与问题
此架构使用sentencepiece
分词器。在transformers==4.27
之前的版本中运行该模型,需要手动安装sentencepiece
。
📄 许可证
本项目采用MIT许可证。