语言: "斯洛文尼亚语"
许可证: "cc-by-sa-4.0"
标签:
示例:
- 文本: "Silva, ti si grda in neprijazna"(西尔瓦,你又丑又不友好)
基于EMBEDDIA/sloberta
模型并在FRENK数据集上微调的文本分类模型,该数据集包含针对LGBT群体和移民的仇恨言论。微调仅使用了数据集的斯洛文尼亚语部分,并重新标记为二元分类(冒犯性或可接受性)。
微调超参数
使用simpletransformers
进行微调。在此之前进行了简短的超参数优化,预设最优超参数为:
model_args = {
"num_train_epochs": 14,
"learning_rate": 1e-5,
"train_batch_size": 21,
}
性能表现
为进行比较,相同的流程还运行了另外两个Transformer模型和fasttext
。记录了6次微调会话的准确率和宏观F1分数,并进行了事后分析。
模型 |
平均准确率 |
平均宏观F1 |
sloberta-frenk-hate |
0.7785 |
0.7764 |
EMBEDDIA/crosloengual-bert |
0.7616 |
0.7585 |
xlm-roberta-base |
0.686 |
0.6827 |
fasttext |
0.709 |
0.701 |
根据记录的准确率和宏观F1分数计算了p值:
与crosloengual-bert
比较:
检验 |
准确率p值 |
宏观F1 p值 |
Wilcoxon |
0.00781 |
0.00781 |
Mann Whithney U检验 |
0.00163 |
0.00108 |
学生t检验 |
0.000101 |
3.95e-05 |
与xlm-roberta-base
比较:
检验 |
准确率p值 |
宏观F1 p值 |
Wilcoxon |
0.00781 |
0.00781 |
Mann Whithney U检验 |
0.00108 |
0.00108 |
学生t检验 |
9.46e-11 |
6.94e-11 |
使用示例
from simpletransformers.classification import ClassificationModel
model_args = {
"num_train_epochs": 6,
"learning_rate": 3e-6,
"train_batch_size": 69}
model = ClassificationModel(
"camembert", "5roop/sloberta-frenk-hate", use_cuda=True,
args=model_args
)
predictions, logit_output = model.predict(["Silva, ti si grda in neprijazna", "Naša hiša ima dimnik"])
predictions
引用
如果使用该模型,请引用原始模型所基于的论文:
@article{DBLP:journals/corr/abs-1907-11692,
author = {Yinhan Liu and
Myle Ott and
Naman Goyal and
Jingfei Du and
Mandar Joshi and
Danqi Chen and
Omer Levy and
Mike Lewis and
Luke Zettlemoyer and
Veselin Stoyanov},
title = {RoBERTa: {A} Robustly Optimized {BERT} Pretraining Approach},
journal = {CoRR},
volume = {abs/1907.11692},
year = {2019},
url = {http://arxiv.org/abs/1907.11692},
archivePrefix = {arXiv},
eprint = {1907.11692},
timestamp = {Thu, 01 Aug 2019 08:59:33 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-1907-11692.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
以及用于微调的数据集:
@misc{ljubešić2019frenk,
title={The FRENK Datasets of Socially Unacceptable Discourse in Slovene and English},
author={Nikola Ljubešić and Darja Fišer and Tomaž Erjavec},
year={2019},
eprint={1906.02045},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/1906.02045}
}