Model Card for Model ID
<This model is a fine-tuned version ofdistilbert-base-uncased on the AG News dataset for 4-class topic text classification.
It was tracked via Weights & Biases (W&B) as part of an MLOps assignment>
Model Details
Model Description
This model is a lightweight text classifier built by fine-tuning DistilBERT. It maps input articles or paragraphs to one of four designated news categories: World, Sports, Business, or Sci/Tech.
- Developed by: Sandeep (Group 13 / IIT Jodhpur)
- Model type: Transformer-based Sequence Classification (DistilBERT)
- Language(s) (NLP): English
- License: Apache-2.0 (Inherited from base DistilBERT model)
- Finetuned from model: distilbert-base-uncased
Model Sources [optional]
Uses
Direct Use
This model is intended to be used directly for classifying short-to-medium length English text fragments into one of four specific categories:
- 0: World
- 1: Sports
- 2: Business
- 3: Sci/Tech
Downstream Use [optional]
[More Information Needed]
Out-of-Scope Use
The model will not perform optimally on languages other than English or text tasks outside the predefined AG News categories (e.g., sentiment analysis, generation, or fine-grained entities).
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
Define target labels
id2label = {"0": "World", "1": "Sports", "2": "Business", "3": "Sci/Tech"}
Load model and tokenizer
model_name = "your-hf-username/your-model-id"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
Sample text classification
text = "The team won the championship match in extra innings."
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
print("Predicted Category:", id2label[str(predicted_class_id)])
[More Information Needed]
Training Details
Training Data
The model was trained using the dataset repository Recurrent/prepared_data_mlops2.
Train Examples: 120,000 rows
Test (Validation) Examples: 7,600 rows
Preprocessing: Inputs were tokenized and clipped to a maximum sequence length of 128 tokens.
[More Information Needed]
Training Procedure
Hyperparameters
The following configuration details apply to the primary model run (run-v1):
Learning Rate: 2e-5
Train Batch Size: 16
Eval Batch Size: 32
Epochs: 3
Weight Decay: 0.01
Evaluation Strategy: Evaluated at the end of every epoch
Best Model Selection: Loaded best model weights at the end based on the highest F1 score.
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed]
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
[More Information Needed]
Results
Evaluation performed on the independent evaluation split yielded the following final metrics:
Final Accuracy: 93.99%
Final F1 Score: 0.9399
Final Evaluation Loss: 0.4236
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the
Machine Learning Impact calculator presented in
Lacoste et al. (2019).
- Hardware Type: Kaggle Environment — 2x NVIDIA Tesla T4 GPUs
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]