-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Chào mừng bạn đến với Wiki chính thức của dự án PhoBERT Comment Classifier — mô hình phân loại cảm xúc bình luận tiếng Việt sử dụng PhoBERT và Hugging Face Transformers.
PhoBERT Comment Classifier là một mô hình AI xử lý ngôn ngữ tự nhiên tiếng Việt, chuyên dùng để phân loại cảm xúc bình luận mạng xã hội thành 4 lớp:
-
🟢 Positive
-
🔴 Negative
-
⚪ Neutral
-
⚠️ Toxic
Mô hình được huấn luyện trên tập dữ liệu gần 5,000 bình luận từ TikTok, Facebook, YouTube và các nền tảng khác.
Cài đặt thủ công:
pip install transformers datasets torch sentencepiece
pip install scikit-learn gradio pandas numpy matplotlib seaborn
Hoặc dùng file requirements.txt:
pip install -r requirements.txt
Tên: vanhai123/vietnamese-social-comments
Cấu trúc:
-
comment: văn bản bình luận -
label: cảm xúc (positive, negative, neutral, toxic) -
category: nhóm ngữ nghĩa hoặc tình huống
Phân phối nhãn:
-
Positive: 35%
-
Negative: 25%
-
Neutral: 25%
-
Toxic: 15%
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("vinai/phobert-base")
model = AutoModelForSequenceClassification.from_pretrained(
"vinai/phobert-base",
num_labels=4,
id2label={0: "negative", 1: "neutral", 2: "positive", 3: "toxic"},
label2id={"negative": 0, "neutral": 1, "positive": 2, "toxic": 3},
)
Huấn luyện với Trainer, logging bằng MLflow nếu cần.
from transformers import pipeline
classifier = pipeline("text-classification", model="vanhai123/phobert-vi-comment-4class")
result = classifier("Tôi không hài lòng về sản phẩm")
| Metric | Value |
|---|---|
| Accuracy | 86% |
| Macro F1 | 83% |
| Best Class | Positive |
| Strong Detection | Toxic |
Unable to register factory for plugin cuDNN...
✅ Giải pháp: Gỡ plugin GPU hoặc chỉ sử dụng CPU nếu runner không có CUDA.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Model logged without a signature...
✅ Thêm input_example vào mlflow.log_model(...)
-
Gradio App Demo
-
4-Class Sentiment
-
Text Rewriting Engine
-
Chatbot integration
-
Multi-language support
-
Mobile SDK/API
Chúng tôi hoan nghênh mọi đóng góp từ cộng đồng:
git clone https://github.com/vanhai123/phobert-comment-classifier.git
git checkout -b feature/your-feature
# Thực hiện sửa đổi, commit và PR
📧 Email: vanhai11203@gmail.com
🤗 HuggingFace: @vanhai123
🌟 Hãy star project nếu bạn thấy hữu ích nhé!