CoolFace
Modelpublic

Nikhil-iitj/distilbert-goodreads-genres

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes11downloads
Model Card

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

MetricScore
Accuracy0.5744
F1 (weighted)0.5736
Eval Loss2.4490

Evaluated on a held-out test set of 1,600 reviews (200 per genre).

How to Use

With Transformers pipeline

python
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

python
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

bibtex
@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}}
}