语言: jv
标签:
- 爪哇语-bert-small
许可证: mit
数据集:
- 维基百科
小部件:
- 文本: "Aku mangan sate ing [MASK] bareng konco-konco"
爪哇语BERT小型版
爪哇语BERT小型版是基于BERT模型的掩码语言模型。它是在最新的(2020年12月下旬)爪哇语维基百科文章上进行训练的。
该模型最初是HuggingFace预训练的英语BERT模型,随后在爪哇语数据集上进行了微调。在验证数据集(占文章的20%)上,其困惑度为22.00。许多使用的技术基于Hugging Face教程笔记本(由Sylvain Gugger编写)和微调教程笔记本(由Pierre Guillou编写)。
Hugging Face的Transformers库被用于训练模型——利用了基础BERT模型及其Trainer
类。训练过程中使用PyTorch作为后端框架,但模型仍兼容TensorFlow。
模型
模型 |
参数量 |
架构 |
训练/验证数据(文本) |
javanese-bert-small |
110M |
BERT小型版 |
爪哇语维基百科(319 MB文本) |
评估结果
模型训练了5个周期,以下是训练结束时的最终结果。
训练损失 |
验证损失 |
困惑度 |
总时间 |
3.116 |
3.091 |
22.00 |
2:7:42 |
使用方法
作为掩码语言模型
from transformers import pipeline
pretrained_name = "w11wo/javanese-bert-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 BertModel, BertTokenizerFast
pretrained_name = "w11wo/javanese-bert-small"
model = BertModel.from_pretrained(pretrained_name)
tokenizer = BertTokenizerFast.from_pretrained(pretrained_name)
prompt = "Indonesia minangka negara gedhe."
encoded_input = tokenizer(prompt, return_tensors='pt')
output = model(**encoded_input)
免责声明
请记住,尽管数据集来源于维基百科,但模型并不总是生成事实性文本。此外,来自维基百科文章的偏见可能会传递到该模型的结果中。
作者
爪哇语BERT小型版由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}
}