CoolFace
Modelpublic

ishaanamahajan/hw2-distilbert-perfume-occasion

sourceHugging Faceapache-2.0updated 6d agoView on Hugging Face
0likes16downloads
Model Card

DistilBERT perfume-occasion classifier

Predict the occasion described by a perfume text. Labels: {0: 'everyday', 1: 'going out', 2: 'formal', 3: 'casual-relaxed'}.

Data and preprocessing

Dataset by ypolatog, CC BY 4.0. Revision: 92447a8453b024751e6b294ddd459109c06a6718. The 100 original descriptions are stratified into 70/15/15 train/validation/test parents. Only training-parent augmentations are added, giving 933 training rows. Exact IDs: split_manifest.json; split SHA256: fca4a560e64ca683154aa4934ba0af9ee52adbd20e358307373b01ce16bbcfe6.

Only text is input. The uncased WordPiece tokenizer truncates at 192 tokens and pads each batch dynamically. Use the exported tokenizer at inference.

Training and compute

Base: distilbert/distilbert-base-uncased, revision 12040accade4e8a0f71eabdb258fecc2e7e948be (Apache 2.0). Full fine-tuning updates the encoder and classification head. AdamW uses learning rate 2e-5, batch size 16, weight decay 0.01, and a linear schedule with 10% warmup over five epochs. The best validation macro F1 checkpoint is restored. Random/data seed: 24679. Fit time: 32.23 seconds. Hardware: {'platform': 'Linux-6.6.122+-x8664-with-glibc2.39', 'processor': 'x8664', 'python': '3.13.15', 'device': 'cuda', 'accelerator': 'Tesla T4'}. Precision: FP16 mixed precision. Package versions: {'torch': '2.11.0+cu128', 'transformers': '4.57.6', 'datasets': '4.8.5', 'huggingface_hub': '0.36.2', 'scikit-learn': '1.7.2', 'numpy': '2.1.3', 'pandas': '2.2.3'}.

Test results

Accuracy 0.4000; macro F1 0.3095; test size 15. Majority baseline: accuracy 0.4000, macro F1 0.1429. Zero-recall classes: formal. Scores are fractions; approximate 95% Wilson accuracy interval: 0.198–0.643. Per-class scores: per_class_metrics.json; predictions: test_predictions.csv; five error examples and hypotheses: error_analysis.md; learning curves: training_history.csv.

Limitations and ethics

Labels reflect one author's taste. Only 100 descriptions are independent; synthetic variants can repeat biases or distort meaning. Season and brand cues may fail for other people or perfumes. Fifteen tests give imprecise estimates, and softmax confidence is uncalibrated. No sensitive personal attributes are used. Retain ypolatog's attribution when reusing the data.

Inference

The exported model was reloaded and its predictions verified. After publication:

python
from transformers import pipeline
classifier = pipeline('text-classification', model='ishaanamahajan/hw2-distilbert-perfume-occasion')
classifier('A fresh citrus fragrance for a warm weekend.', truncation=True, max_length=192)

Collaboration and AI disclosure

OpenAI Codex assisted with notebook structure, code drafting, and documentation.