🚀 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分數 |
受限訪問提示 |
我們的模型僅供學術使用。如果您不屬於學術機構,請說明使用我們模型的理由。請允許我們在幾個工作日內手動審核訂閱申請。 |
受限訪問字段 |
姓名、國家、機構、機構郵箱、請說明您的學術用例 |