模型:
pysentimiento/robertuito-base-cased
READ THE FULL PAPER Github Repository
RoBERTuito是一个预训练的语言模型,用于西班牙语中的用户生成内容,遵循RoBERTa的准则,在500万条推文上进行训练。RoBERTuito提供3种不同的变体:大小写敏感、不区分大小写和不区分大小写+去重音符号。
我们对RoBERTuito进行了在涉及西班牙语用户生成文本的任务基准上的测试。它在性能上胜过了其他预训练语言模型,如BETO、BERTin和RoBERTa-BNE。我们选择了4个任务进行评估,分别是:仇恨言论检测(使用SemEval 2019任务5的HatEval数据集)、情感分析(使用TASS 2020数据集)和讽刺检测(使用IrosVa 2019数据集)。
model | hate speech | sentiment analysis | emotion analysis | irony detection | score |
---|---|---|---|---|---|
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 |
我们在huggingface模型中心发布了预训练模型:
在测试蒙特卡洛方法时,请注意空格是在SentencePiece的标记中进行编码的。所以,如果你想测试
Este es un día<mask>
请在 "día" 和 "mask"之间不要加上空格
重要--请先阅读本文
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) # ['<s>','▁Esto','▁es','▁un','▁tweet','▁estoy','▁usando','▁','▁hashtag','▁','▁ro','bert','uito','▁@usuario','▁','▁emoji','▁cara','▁revolviéndose','▁de','▁la','▁risa','▁emoji','</s>']
我们正在努力将这个预处理步骤整合到transformers库中的分词器中
如果您使用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.", }