Downloads · 30 days
27
6% of all-time downloads
jojo-ai-mst/BurmeseBert
BurmeseBert is a fill-mask model from jojo-ai-mst. Use it when you need the model to fill a missing word. It is set up for transformers.
Burmese-Bert is a Bilingual Mask Language Model based on "bert-large-uncased".
Downloads · 30 days
27
6% of all-time downloads
All-time downloads
434
Public
Parameters
380M
1.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.5 GB · 99%
From the Hugging Face model README
Burmese-Bert is a Bilingual Mask Language Model based on "bert-large-uncased".
The architecture is based on bidirectional encoder representations from transformers.
Supports English and Burmese language.
Coming Soon
# install the dependencies
pip install transformers
from transformers import AutoModelForMaskedLM,AutoTokenizer
model_checkpoint = "jojo-ai-mst/BurmeseBert"
model = AutoModelForMaskedLM.from_pretrained(model_checkpoint)
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
text = "This is a great [MASK]."
import torch
inputs = tokenizer(text, return_tensors="pt")
token_logits = model(**inputs).logits
# Find the location of [MASK] and extract its logits
mask_token_index = torch.where(inputs["input_ids"] == tokenizer.mask_token_id)[1]
mask_token_logits = token_logits[0, mask_token_index, :]
# Pick the [MASK] candidates with the highest logits
top_5_tokens = torch.topk(mask_token_logits, 5, dim=1).indices[0].tolist()
for token in top_5_tokens:
print(f"'>>> {text.replace(tokenizer.mask_token, tokenizer.decode([token]))}'")
Coming Soon