🚀 RoBERTuito-base-deacc
RoBERTuito 是一個針對西班牙語社交媒體文本的預訓練語言模型,在 5 億條推文上按照 RoBERTa 準則進行訓練,能有效處理用戶生成的內容。它有三種變體:區分大小寫、不區分大小寫和不區分大小寫且去除重音,在多項西班牙語用戶生成文本任務基準測試中表現優於其他預訓練語言模型。
🚀 快速開始
RoBERTuito 尚未完全集成到 huggingface/transformers
中。要使用它,首先需要安裝 pysentimiento
:
pip install pysentimiento
在將文本輸入分詞器之前,使用 pysentimiento.preprocessing.preprocess_tweet
對文本進行預處理:
from transformers import AutoTokenizer
from pysentimiento.preprocessing import preprocess_tweet
tokenizer = AutoTokenizer.from_pretrained('pysentimiento/robertuito-base-cased')
text = "Esto es un tweet estoy usando #Robertuito @pysentimiento 🤣"
preprocessed_text = preprocess_tweet(text, ha)
tokenizer.tokenize(preprocessed_text)
你可以在這個筆記本中查看文本分類示例: 
✨ 主要特性
- 針對性訓練:專門針對西班牙語社交媒體文本進行預訓練,在處理用戶生成的內容方面表現出色。
- 多種變體:提供區分大小寫、不區分大小寫和不區分大小寫且去除重音三種變體,滿足不同需求。
- 性能優越:在仇恨言論檢測、情感和情緒分析、反諷檢測等多項基準測試任務中,表現優於其他西班牙語預訓練語言模型,如 BETO、BERTin 和 RoBERTa-BNE。
📦 安裝指南
要使用 RoBERTuito,請先安裝 pysentimiento
:
pip install pysentimiento
💻 使用示例
基礎用法
from transformers import AutoTokenizer
from pysentimiento.preprocessing import preprocess_tweet
tokenizer = AutoTokenizer.from_pretrained('pysentimiento/robertuito-base-cased')
text = "Esto es un tweet estoy usando #Robertuito @pysentimiento 🤣"
preprocessed_text = preprocess_tweet(text, ha)
tokenizer.tokenize(preprocessed_text)
高級用法
在進行文本分類任務時,可以參考以下筆記本中的示例: 
📚 詳細文檔
模型發佈
我們在 Hugging Face 模型中心發佈了預訓練模型:
掩碼語言模型(Masked LM)測試
測試掩碼語言模型時,需要注意空格是在 SentencePiece 的標記內編碼的。因此,如果你想測試:
Este es un día<mask>
不要在 día
和 <mask>
之間留空格。
性能對比
模型 |
仇恨言論檢測 |
情感分析 |
情緒分析 |
反諷檢測 |
綜合得分 |
robertuito-uncased |
0.801 ± 0.010 |
0.707 ± 0.004 |
0.551 ± 0.011 |
0.736 ± 0.008 |
0.6987 |
robertuito-deacc |
0.798 ± 0.008 |
0.702 ± 0.004 |
0.543 ± 0.015 |
0.740 ± 0.006 |
0.6958 |
robertuito-cased |
0.790 ± 0.012 |
0.701 ± 0.012 |
0.519 ± 0.032 |
0.719 ± 0.023 |
0.6822 |
roberta-bne |
0.766 ± 0.015 |
0.669 ± 0.006 |
0.533 ± 0.011 |
0.723 ± 0.017 |
0.6726 |
bertin |
0.767 ± 0.005 |
0.665 ± 0.003 |
0.518 ± 0.012 |
0.716 ± 0.008 |
0.6666 |
beto-cased |
0.768 ± 0.012 |
0.665 ± 0.004 |
0.521 ± 0.012 |
0.706 ± 0.007 |
0.6651 |
beto-uncased |
0.757 ± 0.012 |
0.649 ± 0.005 |
0.521 ± 0.006 |
0.702 ± 0.008 |
0.6571 |
📄 許可證
如果你使用 RoBERTuito,請引用我們的論文:
@inproceedings{perez-etal-2022-robertuito,
title = "{R}o{BERT}uito: a pre-trained language model for social media text in {S}panish",
author = "P{\'e}rez, Juan Manuel and
Furman, Dami{\'a}n Ariel and
Alonso Alemany, Laura and
Luque, Franco M.",
booktitle = "Proceedings of the Thirteenth Language Resources and Evaluation Conference",
month = jun,
year = "2022",
address = "Marseille, France",
publisher = "European Language Resources Association",
url = "https://aclanthology.org/2022.lrec-1.785",
pages = "7235--7243",
abstract = "Since BERT appeared, Transformer language models and transfer learning have become state-of-the-art for natural language processing tasks. Recently, some works geared towards pre-training specially-crafted models for particular domains, such as scientific papers, medical documents, user-generated texts, among others. These domain-specific models have been shown to improve performance significantly in most tasks; however, for languages other than English, such models are not widely available. In this work, we present RoBERTuito, a pre-trained language model for user-generated text in Spanish, trained on over 500 million tweets. Experiments on a benchmark of tasks involving user-generated text showed that RoBERTuito outperformed other pre-trained language models in Spanish. In addition to this, our model has some cross-lingual abilities, achieving top results for English-Spanish tasks of the Linguistic Code-Switching Evaluation benchmark (LinCE) and also competitive performance against monolingual models in English Twitter tasks. To facilitate further research, we make RoBERTuito publicly available at the HuggingFace model hub together with the dataset used to pre-train it.",
}
⚠️ 重要提示
RoBERTuito 尚未完全集成到 huggingface/transformers
中,使用時需要先安裝 pysentimiento
並對文本進行預處理。
💡 使用建議
在使用 RoBERTuito 時,建議使用 pysentimiento.preprocessing.preprocess_tweet
對輸入文本進行預處理,以獲得更好的效果。同時,可以參考提供的 Colab 筆記本示例進行文本分類等任務。