Downloads · 30 days
0
dat201204/phobert-vi-caucu-classifier
phobert-vi-caucu-classifier is a text classification model from dat201204. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
PhoBERT-based Vietnamese Facebook comment classifier for detecting "cầu cứu" comments during natural-disaster situations.
Downloads · 30 days
0
Access
Public
Updated Mar 26, 2026
Repo size
4.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors4.7 MB · 70%
From the Hugging Face model README
PhoBERT-based Vietnamese Facebook comment classifier for detecting "cầu cứu" comments during natural-disaster situations.
0: khong_cau_cuu1: cau_cuuThis model is designed to prioritize high recall for emergency rescue requests in Vietnamese social-media comments, especially when comments may contain distress language, location hints, phone numbers, or SOS markers.
vinai/phobert-base/content/phobert-cau-cuu/saved_model/checkpoint-1710.4941target_recall with validation target recall 0.880.84690.8380cau_cuu): 0.8000cau_cuu): 0.8955cau_cuu): 0.72290.85200.8430cau_cuu): 0.8054cau_cuu): 0.9091cau_cuu): 0.7229107 23
6 60
Convert logits to probabilities and classify as cau_cuu when:
prob_cau_cuu >= 0.4941
This threshold was chosen on the validation set to preserve strong recall while improving F1(cau_cuu) and overall accuracy.
import torch
from peft import AutoPeftModelForSequenceClassification
from transformers import AutoTokenizer
repo_id = "dat201204/phobert-vi-caucu-classifier"
threshold = 0.4941
tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False)
model = AutoPeftModelForSequenceClassification.from_pretrained(repo_id)
model.eval()
text = "Cuu voi, nha em dang ngap va co nguoi gia bi ket"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
prob_cau_cuu = torch.softmax(logits, dim=-1)[0, 1].item()
label = "cau_cuu" if prob_cau_cuu >= threshold else "khong_cau_cuu"
print({"label": label, "prob_cau_cuu": prob_cau_cuu})