Nikhil-iitj/distilbert-goodreads-genres
011
DistilBERT Goodreads Genre Classification
Fine-tuned DistilBERT model for classifying Goodreads book reviews into 8 genres.
Model Description
This model is a fine-tuned version of distilbert-base-cased on the UCSD Goodreads Book Graph review dataset. It classifies book reviews into one of eight genres using the Hugging Face Transformers Trainer API.
Intended Uses
- Direct use: Predict the genre of a book given a user-written review text.
- Downstream use: Content tagging, recommendation systems, book cataloguing pipelines.
Training Details
- Base model:
distilbert-base-cased - Dataset: UCSD Goodreads Book Graph (8 genres, 800 train / 200 test per genre)
- Max length: 512 tokens
- Epochs: 3
- Batch size: 10 (train), 16 (eval)
- Learning rate: 5e-5
- Warmup steps: 100
- Weight decay: 0.01
- Optimizer: AdamW
- Platform: Kaggle GPU T4 x2
Evaluation Results
Evaluated on a held-out test set of 1,600 reviews (200 per genre).
How to Use
With Transformers pipeline
from transformers import pipeline
pipe = pipeline("text-classification", model="Nikhil-iitj/distilbert-goodreads-genres")
result = pipe("A magical world full of wonder and delight...")
print(result)With Transformers AutoModel
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Nikhil-iitj/distilbert-goodreads-genres")
model = AutoModelForSequenceClassification.from_pretrained("Nikhil-iitj/distilbert-goodreads-genres")Limitations and Bias
- The dataset is sampled and may not represent all books globally.
- Genres overlap (e.g., fantasy vs. young adult), so misclassifications occur.
- Review length is truncated to 512 tokens; longer reviews lose tail content.
- Not intended for critical applications without human-in-the-loop validation.
Citation
@misc{distilbert_goodreads_genres,
title={DistilBERT Fine-Tuned for Goodreads Genre Classification},
author={Nikhil Saini},
year={2026},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/Nikhil-iitj/distilbert-goodreads-genres}}
}