Downloads · 30 days
0
minhy112/viclickbait_gnn
viclickbait_gnn is a machine learning model from minhy112. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Phân loại tiêu đề tiếng Việt clickbait / non-clickbait trên bộ dữ liệu ViClickbait-2025 bằng 4 hướng thực nghiệm:
Downloads · 30 days
0
Access
Public
Updated Apr 17, 2026
Repo size
577 MB
Likes
0
Public
Click a slice to open those files.
.pt567 MB · 96%
From the Hugging Face model README
Phân loại tiêu đề tiếng Việt clickbait / non-clickbait trên bộ dữ liệu ViClickbait-2025 bằng 4 hướng thực nghiệm:
TF-IDF + Logistic RegressionPhoBERT-onlyGCN-onlyPhoBERT + GCN FusionProject này đã được chạy thực nghiệm đầy đủ và đã sinh sẵn log, checkpoint, metric, confusion matrix và file dự đoán trong thư mục outputs/.
Mục tiêu của project là kiểm tra tính khả thi của một mô hình lai gồm:
PhoBERT mã hóa tiêu đề.GCN học trên similarity graph giữa các tiêu đề.Pipeline tổng quát:
title và label.train / val / test theo stratified split.TF-IDF + LR và PhoBERT-only.k-NN graph với k=5 và k=10.GCN-only và Fusion.Dữ liệu gốc nằm trong:
data/raw/clickbait_dataset_vietnamese.csvdata/raw/clickbait_dataset_vietnamese.jsonlSau preprocessing:
3414non-clickbait: 2349clickbait: 1065Thiết lập chia dữ liệu:
train: 2389val: 342test: 683| Model | Config | Accuracy | Precision | Recall | Macro-F1 |
|---|---|---|---|---|---|
| TF-IDF + Logistic Regression | baseline | 0.7540 | 0.7164 | 0.7276 | 0.7210 |
| PhoBERT-only | vinai/phobert-base, 5 epochs | 0.8448 | 0.8171 | 0.8308 | 0.8231 |
| GCN-only | k=10 selected by validation | 0.8433 | 0.8167 | 0.8207 | 0.8187 |
| PhoBERT + GCN Fusion | k=5 selected by validation | 0.8463 | 0.8185 | 0.8357 | 0.8258 |
Ghi chú:
Fusion k=10 có test Macro-F1 = 0.8265, nhỉnh hơn Fusion k=5.outputs/fusion/ được giữ theo cấu hình k=5 vì đây là run được chọn bằng validation, phù hợp cách báo cáo thực nghiệm chuẩn hơn.Chi tiết đầy đủ nằm tại:
viclickbait_gnn/
├── REPORT_DRAFT.md
├── appendix/
├── configs/
├── data/
│ ├── raw/
│ ├── processed/
│ └── graphs/
├── outputs/
│ ├── baseline/
│ ├── phobert/
│ ├── gcn/
│ ├── fusion/
│ ├── gcn_k5/
│ ├── gcn_k10/
│ ├── fusion_k5/
│ └── fusion_k10/
├── requirements.txt
└── src/
cd /root/gnn/viclickbait_gnn
python3 src/preprocess.py \
--input data/raw/clickbait_dataset_vietnamese.csv \
--output data/processed/all.csv
python3 src/split_data.py \
--input data/processed/all.csv \
--output_dir data/processed \
--train_ratio 0.7 \
--val_ratio 0.1 \
--test_ratio 0.2 \
--seed 42
python3 src/train_baseline.py \
--train data/processed/train.csv \
--val data/processed/val.csv \
--test data/processed/test.csv \
--output_dir outputs/baseline
python3 src/train_phobert.py \
--train data/processed/train.csv \
--val data/processed/val.csv \
--test data/processed/test.csv \
--output_dir outputs/phobert \
--model vinai/phobert-base \
--device cuda
python3 src/extract_embeddings.py \
--input data/processed/all.csv \
--model vinai/phobert-base \
--checkpoint outputs/phobert/best_model.pt \
--backend transformer \
--batch_size 32 \
--max_length 64 \
--pooling cls \
--output data/graphs/node_features.npy \
--device cuda
python3 src/build_graph.py \
--features data/graphs/node_features.npy \
--k 5 \
--store_features \
--output data/graphs/graph_knn_k5.pt
python3 src/build_graph.py \
--features data/graphs/node_features.npy \
--k 10 \
--store_features \
--output data/graphs/graph_knn_k10.pt
python3 src/train_gnn.py \
--all data/processed/all.csv \
--train data/processed/train.csv \
--val data/processed/val.csv \
--test data/processed/test.csv \
--graph data/graphs/graph_knn_k10.pt \
--output_dir outputs/gcn \
--device cuda
python3 src/train_fusion.py \
--all data/processed/all.csv \
--train data/processed/train.csv \
--val data/processed/val.csv \
--test data/processed/test.csv \
--graph data/graphs/graph_knn_k5.pt \
--output_dir outputs/fusion \
--device cuda
Các file trong configs/ lưu bộ siêu tham số chuẩn của project:
Hiện tại các script nhận tham số qua CLI là chính. Các file YAML đóng vai trò cấu hình tham chiếu để đưa vào báo cáo và tái lập thực nghiệm.
Mỗi thư mục run có thể chứa:
train.logbest_model.ptmetrics.jsonconfusion_matrix.pngcls_report.txtpred_test.csvThư mục chính để trích số cho báo cáo:
Thư mục ablation:
node_id được tạo cố định ngay sau bước preprocessing để tránh lệch thứ tự giữa CSV, embedding và graph.GCN và Fusion được huấn luyện theo kiểu full-graph, nhưng loss chỉ tính trên train labels.validation, không theo test.NVIDIA GeForce RTX 4090.