YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
DLNLP - Vietnamese Hate Speech Detection
This repository contains a local notebook workflow for Vietnamese hate speech detection.
Project Structure
data/raw: raw CSV filesdata/processed: cleaned CSV files generated by preprocessingnotebooks: notebook pipelineoutputs/figures: saved charts and confusion matricesoutputs/models: trained model artifactsoutputs/results: metrics, reports, and prediction files
Dữ liệu đầu vào
The preprocessing notebook expects these files in data/raw:
train_raw.csvval_raw.csvtest_raw.csv
Each file should contain at least:
free_textlabel_id
Setup
Create and activate a virtual environment, then install dependencies:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
If you already have a working Python environment, installing from requirements.txt is enough.
How to run locally
Run the notebooks in this order:
notebooks/01_data_preprocessing.ipynbnotebooks/02_baseline_tfidf_svm.ipynbnotebooks/03_bilstm_train_evaluate.ipynbnotebooks/04_phobert_train_evaluate.ipynbnotebooks/05_results_error_analysis.ipynb
Demo giao diện
Sau khi đã có các file model trong outputs/models, chạy giao diện demo bằng:
streamlit run app.py
Notes
- To make the repository clone-and-run for the demo app, keep the trained artifacts in
outputs/models. - Do not commit local environment folders such as
.venv, notebook caches, or temporary training checkpoints. - The notebooks resolve the project root automatically from the local workspace, so Colab Drive mounting is not required.
- Notebook 1 creates
data/processedfrom the raw CSV files. - Notebooks 2, 3, and 4 write outputs into
outputs/models,outputs/results, andoutputs/figures. - Notebook 5 reads the artifacts from those local output folders and performs comparison/error analysis.
- For notebook 3 and notebook 4, the package list includes
pyvi,transformers,torch, andaccelerate.
Expected outputs
After a full run, you should see files such as:
data/processed/train_processed.csvoutputs/models/svm_model.jobliboutputs/models/bilstm_best.ptoutputs/models/phobert_base/outputs/results/svm_metrics.csvoutputs/results/bilstm_metrics.csvoutputs/results/phobert_metrics.csvoutputs/results/phobert_test_predictions.csvoutputs/figures/*.png
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support