Views
No views yet
bert-base-uncased fine-tuned on the IMDB sentiment classification dataset with max_seq_length=512.bert-base-uncased (12 layers, 768 hidden, 12 heads, ~110M parameters)bert-base-uncased on the IMDB train split (25,000 examples) using TextAttack 0.3.x.| Hyperparameter | Value |
|---|---|
| Epochs | 5 |
| Per-device batch size | 8 |
| Gradient accumulation | 2 (effective batch 16) |
| Learning rate | 2e-5 |
| Weight decay | 0.01 |
| Warmup steps | 500 |
| Random seed | 786 |
| Hardware | NVIDIA RTX 3090 (24 GB) |
textattack train --model-name-or-path bert-base-uncased \
--dataset imdb \
--model-max-length 512 \
--epochs 5 \
--per-device-train-batch-size 8 \
--gradient-accumulation-steps 2 \
--learning-rate 2e-5 \
--save-last \
--output-dir ./models/bert-imdb-512| Metric | Value |
|---|---|
| Accuracy | 94.14% |
textattack/bert-base-uncased-imdb) reports ~89% on the same test set.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3tokenizer = AutoTokenizer.from_pretrained("jongador/bert-imdb-512")
4model = AutoModelForSequenceClassification.from_pretrained("jongador/bert-imdb-512")
5
6inputs = tokenizer("I loved this movie!", return_tensors="pt", truncation=True, max_length=512)
7outputs = model(**inputs)
8prediction = outputs.logits.argmax(-1).item() # 0 = negative, 1 = positive