Downloads · 30 days
0
ssg1/2026-24679-distilbert-nj-text
2026-24679-distilbert-nj-text is a text classification model from ssg1. Use it when you need a label for a piece of text. It is set up for autogluon. The card lists the license as cc-by-4.0.
Given a short passage about life in the US Northeast, predicts whether it describes New Jersey (1) or New York / Pennsylvania (0).
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2026
Repo size
266 MB
Likes
0
Public
Click a slice to open those files.
.ckpt265 MB · 100%
From the Hugging Face model README
Given a short passage about life in the US Northeast, predicts whether it describes New Jersey (1) or New York / Pennsylvania (0).
Homework 2 (fine-tuning a small text model) for 24-679 Designing with AI. Coursework only.
yennik16/ny-pa-nj-text, written by a classmate: 100 passages of
about 200 characters on food, law, transport, geography and culture, each about one state.
| Split | Rows | Original passages | NJ / other |
|---|---|---|---|
| train | 1070 | 70 | 536 / 534 |
| validation | 15 | 15 | 7 / 8 |
| test | 15 | 15 | 8 / 7 |
Published splits used unchanged. No passage crosses splits; validation and test are originals only (both checked in the notebook). Training augmentation (by the dataset author) is character noise, word dropout, word swaps and sentence shuffling at four strengths.
Input is the text column only. The state column is the label at finer grain and is excluded.
Tokenization is DistilBERT's uncased WordPiece, truncated at 128 tokens (passages are far shorter).
No extra augmentation during training.
AutoGluon Multimodal 1.6.1, distilbert-base-uncased, seed 24679,
5 epochs, batch size 8, weight decay 0.01, layer-wise learning-rate decay, validation after
each epoch, best single checkpoint kept.
Three fine-tuning modes were compared on validation:
| Mode | LR | Trainable | Val accuracy | Val log loss | Fit (s) |
|---|---|---|---|---|---|
bit_fit | 0.001 | 0.08% | 73.3% | 0.6429 | 28 |
full | 2e-05 | 100.00% | 66.7% | 1.7988 | 45 |
norm_fit | 0.0001 | 0.09% | 53.3% | 0.6686 | 22 |
Selected: bit_fit (learning rate 0.001; 52,994 of
66,364,418 parameters trainable), by validation accuracy with log loss as tiebreak.
| Metric | DistilBERT | Majority class |
|---|---|---|
| Accuracy | 53.3% | 53.3% |
| Balanced accuracy | 51.8% | 50.0% |
| Weighted F1 | 0.507 | 0.371 |
| Precision (NJ) | 0.545 | 0.533 |
| Recall (NJ) | 0.750 | 1.000 |
95% exact (Clopper-Pearson) interval on test accuracy: 26.6% – 78.7%. One error moves accuracy by 6.7 points.
Misclassified holdout passages (validation and test):
Why. Accuracy by state on the 30 holdout passages: NJ 73%, NY 86%, PA 25%. Half the PA errors are about cars or law, and their closest training passages are New Jersey ones about driving, so the model learned topic rather than state. For 7 of 11 errors, the most similar training passage carries the other label. Naming a state did not raise accuracy, only confidence. The task needs facts (which chains, laws and places belong to which state) that 70 training passages do not contain.
Tesla T4; three fits totalling 94 s. Python 3.13.15, PyTorch 2.11.0+cu128.
from pathlib import Path
import pandas as pd
from huggingface_hub import snapshot_download
from autogluon.multimodal import MultiModalPredictor
path = Path(snapshot_download("ssg1/2026-24679-distilbert-nj-text", allow_patterns=["automm/*"]))
model = MultiModalPredictor.load(str(path / "automm"))
model.predict(pd.DataFrame({"text": ["Full-service gas stations are the law here."]})) # 1 = NJ
Claude helped choose the dataset, draft the notebook from the course reference, and draft this card from values computed in the run. Settings, results and error analysis were checked against notebook output. The passages are a classmate's; none were generated for this model.
Sohum Goel, CMU 24-679, Fall 2026. Dataset by yennik16, CC BY 4.0.