language: jv
tags:
- javanese-distilbert-small
license: mit
datasets:
- wikipedia
widget:
- text: "Joko [MASK] wis kelas siji SMA."
爪哇语DistilBERT小型模型
爪哇语DistilBERT小型是基于DistilBERT模型的掩码语言模型。该模型在最新(2020年12月下旬)的爪哇语维基百科文章上进行训练。
该模型最初是HuggingFace预训练的英文DistilBERT模型,随后在爪哇语数据集上进行了微调。在验证数据集(占文章的20%)上,其困惑度为23.54。许多使用的技术基于Hugging Face教程笔记本(由Sylvain Gugger编写)和微调教程笔记本(由Pierre Guillou编写)。
训练使用了Hugging Face的Transformers库,利用了基础DistilBERT模型及其Trainer
类。训练过程中使用PyTorch作为后端框架,但模型仍兼容TensorFlow。
模型
模型 |
参数量 |
架构 |
训练/验证数据(文本) |
javanese-distilbert-small |
66M |
DistilBERT小型 |
爪哇语维基百科(319 MB文本) |
评估结果
模型训练了5个周期,训练结束时的最终结果如下。
训练损失 |
验证损失 |
困惑度 |
总时间 |
3.088 |
3.153 |
23.54 |
1:46:37 |
使用方法
作为掩码语言模型
from transformers import pipeline
pretrained_name = "w11wo/javanese-distilbert-small"
fill_mask = pipeline(
"fill-mask",
model=pretrained_name,
tokenizer=pretrained_name
)
fill_mask("Aku mangan sate ing [MASK] bareng konco-konco")
在PyTorch中进行特征提取
from transformers import DistilBertModel, DistilBertTokenizerFast
pretrained_name = "w11wo/javanese-distilbert-small"
model = DistilBertModel.from_pretrained(pretrained_name)
tokenizer = DistilBertTokenizerFast.from_pretrained(pretrained_name)
prompt = "Indonesia minangka negara gedhe."
encoded_input = tokenizer(prompt, return_tensors='pt')
output = model(**encoded_input)
免责声明
请注意,尽管数据集源自维基百科,但模型生成的文本可能并不总是事实准确。此外,维基百科文章中的偏见可能会延续到该模型的结果中。
作者
爪哇语DistilBERT小型模型由Wilson Wongso训练和评估。所有计算和开发均在Google Colaboratory上使用其免费GPU资源完成。
引用
如果您在研究中使用了我们的任何模型,请引用:
@inproceedings{wongso2021causal,
title={Causal and Masked Language Modeling of Javanese Language using Transformer-based Architectures},
author={Wongso, Wilson and Setiawan, David Samuel and Suhartono, Derwin},
booktitle={2021 International Conference on Advanced Computer Science and Information Systems (ICACSIS)},
pages={1--7},
year={2021},
organization={IEEE}
}