CoolFace
Modelpublic

YuvarajK-g25ait2054/distilbert-goodreads-genres-V2

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes9downloads
Model Card

DistilBERT Goodreads Genre Classification

Model Details

Developed by: Yuvaraj K Model type: DistilBERT for Sequence Classification Language: English Finetuned from: distilbert-base-cased Training platform: Kaggle GPU Experiment tracking: Weights & Biases


Model Description

This model is a fine-tuned DistilBERT transformer model for multi-class text classification on Goodreads book review text.

The objective of this project was to build a complete MLOps workflow including:

  • —Kaggle GPU training
  • —secure API token handling with Kaggle Secrets
  • —experiment tracking using Weights & Biases
  • —evaluation artifact logging
  • —model versioning and deployment using Hugging Face Hub
  • —reproducibility with GitHub

DistilBERT was selected because it is computationally efficient, lightweight, and well-suited for free GPU environments while maintaining competitive NLP performance.


Training Data

Dataset: Goodreads book review classification dataset

Classification task: Multi-class genre classification

Number of classes: 8

Example classes:

  • —Fiction
  • —Fantasy
  • —Mystery
  • —Romance
  • —Thriller
  • —History
  • —Science Fiction
  • —Biography

Training Configuration

Base model: distilbert-base-cased

Hyperparameters:

  • —Epochs: 3
  • —Training batch size: 8
  • —Evaluation batch size: 16
  • —Weight decay: 0.01
  • —Warmup steps: 100
  • —Evaluation strategy: epoch
  • —Save strategy: epoch
  • —Optimizer: AdamW

Training platform:

  • —Kaggle Notebook
  • —GPU enabled

Evaluation Results

MetricScore
Accuracy0.6031
F1 Score0.6007
Eval Loss2.2373

Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "YuvarajK-g25ait2054/distilbert-goodreads-genres-V2"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

text = "This mystery novel was suspenseful and brilliantly written."

inputs = tokenizer(
    text,
    return_tensors="pt",
    truncation=True,
    padding=True
)

outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1)

print(prediction)

Intended Use

This model is intended for:

  • —educational NLP experimentation
  • —text classification demonstrations
  • —academic MLOps assignments
  • —transformer fine-tuning examples

Limitations

  • —trained on assignment dataset only
  • —performance may vary on unseen real-world text
  • —not validated for production deployment
  • —classification quality depends on dataset label quality

Resources

Weights & Biases Dashboard: https://wandb.ai/g25ait2054-iit-jodhpur/mlops-assignment2

Hugging Face Model: https://huggingface.co/YuvarajK-g25ait2054/distilbert-goodreads-genres-V2

Kaggle Notebook: https://www.kaggle.com/code/kyuvarajg25ait2054/g25ait2054-yuvaraj

GitHub Repository: https://github.com/YuvarajK-g25ait2054/Mlops_assignment2