Downloads · 30 days
1.2K
29% of all-time downloads
hon9kon9ize/bert-base-cantonese
bert-base-cantonese is a fill-mask model from hon9kon9ize. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
1.2K
29% of all-time downloads
All-time downloads
4.1K
Public
Parameters
103M
822 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors411 MB · 100%
From the Hugging Face model README
This model is a continuation of indiejoseph/bert-base-cantonese, a BERT-based model pre-trained on a substantial corpus of Cantonese text. The dataset was sourced from a variety of platforms, including news articles, social media posts, and web pages. The text was segmented into sentences containing 11 to 460 tokens per line. To ensure data quality, Minhash LSH was employed to eliminate near-duplicate sentences, resulting in a final dataset comprising 161,338,273 tokens. Training was conducted using the run_mlm.py script from the transformers library.
This continuous pre-training aims to expand the model's knowledge with more up-to-date Hong Kong and Cantonese text data. So we slightly overfit the model with higher learng rate and more epochs.
from transformers import pipeline
pipe = pipeline("fill-mask", model="hon9kon9ize/bert-base-cantonese")
pipe("香港特首係李[MASK]超")
# [{'score': 0.3057154417037964,
# 'token': 2157,
# 'token_str': '家',
# 'sequence': '香 港 特 首 係 李 家 超'},
# {'score': 0.08251259475946426,
# 'token': 6631,
# 'token_str': '超',
# 'sequence': '香 港 特 首 係 李 超 超'},
# ...
pipe("我睇到由治及興帶嚟[MASK]好處")
# [{'score': 0.9563464522361755,
# 'token': 1646,
# 'token_str': '嘅',
# 'sequence': '我 睇 到 由 治 及 興 帶 嚟 嘅 好 處'},
# {'score': 0.00982475932687521,
# 'token': 4638,
# 'token_str': '的',
# 'sequence': '我 睇 到 由 治 及 興 帶 嚟 的 好 處'},
# ...
This model is intended to be used for further fine-tuning on Cantonese downstream tasks.
The following hyperparameters were used during training: