Downloads · 30 days
21
1% of all-time downloads
cbc-528a/BamiBERT-ViMedNER
BamiBERT-ViMedNER is a token classification model from cbc-528a. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as bsd-3-clause-clear.
This model is fine-tuned from Qualcomm-AI-Research/BamiBERT for Vietnamese biomedical Named Entity Recognition (NER).
Downloads · 30 days
21
1% of all-time downloads
All-time downloads
1.5K
Public
Parameters
102M
410 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors410 MB · 100%
From the Hugging Face model README
This model is fine-tuned from Qualcomm-AI-Research/BamiBERT for Vietnamese biomedical Named Entity Recognition (NER).
This model was fine-tuned on the ViMedNER dataset.
Repository: https://github.com/tdtrinh11/ViMedNer
The model was fine-tuned from Qualcomm-AI-Research/BamiBERT for Vietnamese biomedical Named Entity Recognition (NER) using the following training configuration.
| Hyperparameter | Value |
|---|---|
| Max sequence length | 128 |
| Batch size | 32 |
| Learning rate | 5e-5 |
| Number of epochs | 30 |
| Warmup ratio | 0.1 |
| Weight decay | 0.01 |
| Gradient accumulation steps | 1 |
| Optimizer | AdamW |
| Learning rate scheduler | Linear with warmup |
| Task | Token Classification (NER) |
| Framework | Hugging Face Transformers |
The model was evaluated on the ViMedNER test set using the seqeval evaluation metrics for named entity recognition.
| Metric | Score |
|---|---|
| Precision (Micro) | 0.6605 |
| Recall (Micro) | 0.7133 |
| F1 Score (Micro) | 0.6859 |
| Entity Type | Precision | Recall | F1 Score | Support |
|---|---|---|---|---|
ten_benh | 0.77 | 0.84 | 0.81 | 1805 |
trieu_chung_benh | 0.60 | 0.63 | 0.62 | 703 |
bien_phap_dieu_tri | 0.57 | 0.61 | 0.59 | 631 |
bien_phap_chan_doan | 0.64 | 0.67 | 0.66 | 303 |
nguyen_nhan_benh | 0.31 | 0.36 | 0.34 | 276 |
| Average | Precision | Recall | F1 Score |
|---|---|---|---|
| Micro | 0.66 | 0.71 | 0.69 |
| Macro | 0.58 | 0.62 | 0.60 |
| Weighted | 0.66 | 0.71 | 0.69 |
Note: Evaluation was performed using the
seqevallibrary on the official ViMedNER test split. The model achieves an overall micro F1-score of 68.6% on the ViMedNER test set. Performance is strongest on theten_benh(Disease) entity type with an F1-score of 0.81, whilenguyen_nhan_benh(Cause) remains the most challenging category due to its relatively small number of training examples and semantic diversity.
pip install transformers torch
from transformers import AutoTokenizer
from transformers import AutoModelForTokenClassification
MODEL_NAME = "cbc-528a/BamiBERT-ViMedNER"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForTokenClassification.from_pretrained(MODEL_NAME)
import torch
from transformers import AutoTokenizer
from transformers import AutoModelForTokenClassification
MODEL_NAME = "cbc-528a/BamiBERT-ViMedNER"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForTokenClassification.from_pretrained(MODEL_NAME)
sentence = "Bệnh nhân bị ung thư gan và được điều trị bằng Sorafenib."
words = sentence.split()
inputs = tokenizer(
words,
is_split_into_words=True,
return_tensors="pt"
)
with torch.no_grad():
outputs = model(**inputs)
predictions = outputs.logits.argmax(dim=-1)[0]
word_ids = inputs.word_ids()
id2label = model.config.id2label
previous_word = None
for pred, word_idx in zip(predictions, word_ids):
if word_idx is None or word_idx == previous_word:
continue
previous_word = word_idx
print(
words[word_idx],
id2label[pred.item()]
)
Bệnh O
nhân O
bị O
ung B-ten_benh
thư I-ten_benh
gan I-ten_benh
và O
được O
điều O
trị O
bằng O
Sorafenib B-bien_phap_dieu_tri
. O
This model is a fine-tuned derivative of Qualcomm-AI-Research/BamiBERT.
Accordingly, use of this model is subject to:
Please refer to the original BamiBERT repository for the complete license terms.
This model is fine-tuned based on the BamiBERT architecture. I would like to express my gratitude to the original authors for their foundational work.
BibTeX:
@article{BamiBERT,
title = {{BamiBERT: A New BERT-based Language Model for Vietnamese}},
author = {Dat Quoc Nguyen and Thinh Pham and Chi Tran and Linh The Nguyen},
journal = {arXiv preprint},
volume = {arXiv:2607.02259},
year = {2026}
}