Transformer research project
Dataset, Methodology & Evaluation
A fine-tuned BERT encoder classifies English text into four source-defined categories. The results below belong to the deployed checkpoint; chat guidance uses separate, explicitly identified rules.
Executed Transformer experiment
Dataset source and license
Mental Health Text Classification Dataset — ourafla declares CC BY 4.0 and provides English text labeled Anxiety, Depression, Normal and Suicidal. It combines public source corpora; labels are dataset categories, not clinical diagnoses. The original collection consent was not independently audited.
Downloads use a pinned revision and SHA-256 checksums. Exact normalized duplicates and contradictory labels are removed before deriving a stratified validation set. The published test split is reserved and matching training texts are excluded. Raw posts are not included in this repository or website.
There are no reliable author identifiers: near-duplicate and author-level leakage cannot be ruled out. This test is a source-provided benchmark, not independent clinical validation.
Model and methodology
- Architecture
- BERT Transformer (2 layers, 128 hidden units)
- Tokenizer
- Checkpoint-native WordPiece, 128-token maximum
- Training
- PyTorch + Hugging Face; pretrained encoder fully fine-tuned
- Browser inference
- Same checkpoint exported to ONNX; Transformers.js + WebAssembly
- Verify downloaded files and exclude duplicated or conflicting texts.
- Train only on the training split; select the checkpoint by validation macro-F1.
- Evaluate that checkpoint on the held-out test split and publish actual counts, scores and curves.
- Check numerical parity between PyTorch and ONNX before exporting browser assets.
Scope and limitations
The classifier reads the current message only, matching its training data. Conversation rules can use history without replacing the newest message in the model input. Indonesian guidance is unscored; Indonesian model performance is not established.
The 55% abstention threshold is a provisional rule, not calibrated confidence or a proven out-of-distribution detector. This is not a therapy, diagnosis or crisis assessment service.
The former Bi-LSTM validation score used different labels and data; it cannot be directly compared with this experiment.