🚀 爪哇語小型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許可證。