tungtoxic / README.md
huythichai's picture
Add files using upload-large-folder tool
a3cc21b verified

Toxic Classify (Frozen Qwen Embeddings + MLP)

This project builds frozen embeddings using Qwen3-4B-Embedding and trains a small MLP classifier to predict labels $0$–$5$.

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

1) Build embeddings (cached)

python prepare_embeddings.py \
  --data_dir data \
  --output_dir artifacts \
  --model_name Qwen/Qwen3-4B-Embedding

2) Train MLP

python train_mlp.py \
  --embeddings_path artifacts/embeddings.npy \
  --labels_path artifacts/labels.npy \
  --output_dir artifacts

Artifacts are written to artifacts/.