Downloads · 30 days
13
25% of all-time downloads
jongador/cnn-imdb-256
cnn-imdb-256 is a text classification model from jongador. Use it when you need a label for a piece of text. It is set up for textattack. The card lists the license as mit.
⚠️ DEPRECATED — kept for legacy compatibility. This model was trained with maxseqlength=256 and an unconverged 50-epoch / 5e-5 schedule. For new work, use jongador/cnn-imdb-512, which covers ~95–98% of IMDB reviews (v…
Downloads · 30 days
13
25% of all-time downloads
All-time downloads
53
Public
Repo size
321 MB
Likes
0
Public
Click a slice to open those files.
.bin321 MB · 100%
From the Hugging Face model README
⚠️ DEPRECATED — kept for legacy compatibility. This model was trained with
max_seq_length=256and an unconverged 50-epoch / 5e-5 schedule. For new work, usejongador/cnn-imdb-512, which covers ~95–98% of IMDB reviews (vs. ~85–90%), uses a tuned schedule (30 epochs, 1e-4 LR, early stopping), and achieves higher accuracy (86.09% vs. 84.34%).
WordCNN (Kim, 2014) trained on the IMDB sentiment classification dataset with max_seq_length=256. Trained as a victim model for adversarial NLP research (TextBugger / TextFooler / DeepWordBug-style attacks).
Trained from scratch on the IMDB train split (25,000 examples) using TextAttack 0.3.x.
| Hyperparameter | Value |
|---|---|
| Epochs | 50 (no early stopping) |
| Batch size | 64 |
| Learning rate | 5e-5 |
| Weight decay | 0.01 |
| Warmup steps | 500 |
| Random seed | 786 |
| Hardware | NVIDIA RTX 3050 Laptop (4 GB VRAM) |
Eval accuracy peaked around epoch 14 (84.34%) and degraded over the remaining ~36 epochs due to overfitting. The newer jongador/cnn-imdb-512 variant uses a higher learning rate (1e-4), fewer epochs (30), and early stopping (5-epoch patience) to avoid this regime.
Best epoch checkpoint on the IMDB test split (25,000 examples):
| Metric | Value |
|---|---|
| Accuracy | 84.34% |
This model uses the TextAttack custom format and requires the textattack library. TextAttack's from_pretrained does not currently resolve Hugging Face Hub IDs — download the snapshot first via huggingface_hub, then pass the local path:
from huggingface_hub import snapshot_download
from textattack.models.helpers import WordCNNForClassification
local_dir = snapshot_download(repo_id="jongador/cnn-imdb-256")
model = WordCNNForClassification.from_pretrained(local_dir)
MIT