🚀 xlm-roberta-large-twitter-cap-minor
本项目的模型是基于xlm-roberta-large
微调而来,可用于多语言文本分类,能有效处理英文、丹麦语和匈牙利语等不同语言的文本分类任务,为相关学术研究提供了有力支持。
🚀 快速开始
模型描述
这是一个基于xlm-roberta-large
的模型,在多语言(英语、丹麦语、匈牙利语)训练数据上进行了微调。这些训练数据使用了来自比较议程项目的次要主题代码进行标注。
如何使用模型
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
model="poltextlab/xlm-roberta-large-twitter-cap-minor",
task="text-classification",
tokenizer=tokenizer,
use_fast=False,
truncation=True,
max_length=512,
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
参数代替。
✨ 主要特性
- 多语言支持:支持英语、丹麦语和匈牙利语等多语言文本分类。
- 基于微调:在
xlm-roberta-large
基础上进行微调,提高了特定任务的性能。
📦 安装指南
此部分原文档未提及具体安装命令,故跳过。
💻 使用示例
基础用法
from transformers import AutoTokenizer, pipeline
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-large")
pipe = pipeline(
model="poltextlab/xlm-roberta-large-twitter-cap-minor",
task="text-classification",
tokenizer=tokenizer,
use_fast=False,
truncation=True,
max_length=512,
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)
高级用法
原文档未提及高级用法相关代码,故不展示。
📚 详细文档
模型性能
该模型在包含15349个英语示例的测试集(占英语数据的20%)上进行了评估。
合作
通过扩展训练集可以显著提高模型性能。我们欢迎大家提交任何领域和语言的CAP编码语料,可以发送至poltextlab{at}poltextlab{dot}com,也可以使用CAP Babel Machine。
调试与问题解决
此架构使用sentencepiece
分词器。在transformers==4.27
之前的版本中运行该模型,需要手动安装该分词器。
如果在使用from_pretrained()
方法加载模型时遇到RuntimeError
,添加ignore_mismatched_sizes=True
应该可以解决问题。
🔧 技术细节
原文档未提供足够详细的技术实现细节(未超过50字),故跳过。
📄 许可证
本项目采用MIT许可证。
属性 |
详情 |
模型类型 |
基于xlm-roberta-large 微调的多语言文本分类模型 |
训练数据 |
多语言(英语、丹麦语、匈牙利语),使用比较议程项目的次要主题代码标注 |
指标 |
准确率、加权平均F1分数 |
受限访问提示 |
我们的模型仅供学术使用。如果您不属于学术机构,请说明使用我们模型的理由。请允许我们在几个工作日内手动审核订阅申请。 |
受限访问字段 |
姓名、国家、机构、机构邮箱、请说明您的学术用例 |