🚀 西班牙語/英語詞性標註模型
該項目提供了一個用於西班牙語和英語的詞性標註模型,基於特定語料庫訓練,能有效處理代碼切換場景下的詞性標註任務。
🚀 快速開始
本模型的倉庫地址為:https://github.com/pysentimiento/pysentimiento/
此模型是使用 LinCE NER 語料庫 的西班牙語/英語分割數據進行訓練的,這是一個代碼切換基準數據集。基礎模型是 RoBERTuito,它是一個在西班牙語推文上訓練的 RoBERTa 模型。
💻 使用示例
基礎用法
如果您想使用此模型,建議直接從 pysentimiento
庫中調用,因為由於分詞問題,它與 pipeline 的配合可能不太正常。
from pysentimiento import create_analyzer
pos_analyzer = create_analyzer("pos", lang="es")
pos_analyzer.predict("Quiero que esto funcione correctamente! @perezjotaeme")
>[{'type': 'PROPN', 'text': 'Quiero', 'start': 0, 'end': 6},
> {'type': 'SCONJ', 'text': 'que', 'start': 7, 'end': 10},
> {'type': 'PRON', 'text': 'esto', 'start': 11, 'end': 15},
> {'type': 'VERB', 'text': 'funcione', 'start': 16, 'end': 24},
> {'type': 'ADV', 'text': 'correctamente', 'start': 25, 'end': 38},
> {'type': 'PUNCT', 'text': '!', 'start': 38, 'end': 39},
> {'type': 'NOUN', 'text': '@perezjotaeme', 'start': 40, 'end': 53}]
📈 結果
結果取自 LinCE 排行榜:
模型 |
情感分析 |
命名實體識別 |
詞性標註 |
RoBERTuito |
60.6 |
68.5 |
97.2 |
XLM Large |
-- |
69.5 |
97.2 |
XLM Base |
-- |
64.9 |
97.0 |
C2S mBERT |
59.1 |
64.6 |
96.9 |
mBERT |
56.4 |
64.0 |
97.1 |
BERT |
58.4 |
61.1 |
96.9 |
BETO |
56.5 |
-- |
-- |
📖 引用
如果您在研究中使用了此模型,請引用 pysentimiento、RoBERTuito 和 LinCE 的論文:
@misc{perez2021pysentimiento,
title={pysentimiento: A Python Toolkit for Sentiment Analysis and SocialNLP tasks},
author={Juan Manuel Pérez and Juan Carlos Giudici and Franco Luque},
year={2021},
eprint={2106.09462},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@inproceedings{ortega2019overview,
title={Overview of the task on irony detection in Spanish variants},
author={Ortega-Bueno, Reynier and Rangel, Francisco and Hern{\'a}ndez Far{\i}as, D and Rosso, Paolo and Montes-y-G{\'o}mez, Manuel and Medina Pagola, Jos{\'e} E},
booktitle={Proceedings of the Iberian languages evaluation forum (IberLEF 2019), co-located with 34th conference of the Spanish Society for natural language processing (SEPLN 2019). CEUR-WS. org},
volume={2421},
pages={229--256},
year={2019}
}
@inproceedings{aguilar2020lince,
title={LinCE: A Centralized Benchmark for Linguistic Code-switching Evaluation},
author={Aguilar, Gustavo and Kar, Sudipta and Solorio, Thamar},
booktitle={Proceedings of the 12th Language Resources and Evaluation Conference},
pages={1803--1813},
year={2020}
}