🚀 爪哇语小型DistilBERT模型
爪哇语小型DistilBERT模型是一个基于掩码语言的模型,它基于DistilBERT模型构建。该模型在最新(2020年12月下旬)的爪哇语维基百科文章上进行训练。
此模型最初是HuggingFace预训练的英文DistilBERT模型,随后在爪哇语数据集上进行微调。在验证数据集(文章的20%)上,该模型的困惑度达到了23.54。许多使用的技术基于Hugging Face的教程笔记本(由Sylvain Gugger编写),以及微调教程笔记本(由Pierre Guillou编写)。
训练该模型使用了Hugging Face的Transformers库,利用了基础的DistilBERT模型及其Trainer
类。训练过程中使用PyTorch作为后端框架,但该模型仍然与TensorFlow兼容。
✨ 主要特性
- 基于DistilBERT模型,在爪哇语维基百科文章上训练。
- 由英文DistilBERT模型微调而来,在验证集上有较好的困惑度表现。
- 训练使用Hugging Face的Transformers库,兼容TensorFlow。
📦 安装指南
文档未提及安装步骤,暂不展示。
💻 使用示例
基础用法
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")
高级用法
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)
📚 详细文档
模型信息
属性 |
详情 |
模型类型 |
javanese-distilbert-small |
参数数量 |
66M |
架构 |
DistilBERT Small |
训练/验证数据(文本) |
爪哇语维基百科(319 MB文本) |
评估结果
该模型训练了5个周期,训练结束后的最终结果如下:
训练损失 |
验证损失 |
困惑度 |
总时间 |
3.088 |
3.153 |
23.54 |
1:46:37 |
免责声明
请记住,尽管数据集来源于维基百科,但该模型并不总是能生成符合事实的文本。此外,维基百科文章中的偏差可能会延续到该模型的结果中。
作者信息
爪哇语小型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}
}
🔧 技术细节
该模型最初采用HuggingFace预训练的英文DistilBERT模型,然后在爪哇语数据集上进行微调。训练过程使用Hugging Face的Transformers库,利用基础DistilBERT模型和Trainer
类,以PyTorch为后端框架。许多技术参考了相关的Hugging Face教程笔记本。在验证数据集上,模型达到了23.54的困惑度,训练5个周期后得到了相应的训练损失、验证损失等评估结果。
📄 许可证
本项目采用MIT许可证。