AG News Classification
🔬 Research Focus:
Leveraging GPT-2 transformer architecture for multi-class news category classification on the AG News dataset. This model brings the power of Large Language Models to text classification tasks.
📊 Performance Metrics:
• Dataset: 127,600 news articles from AG News.
• Model: GPT-2 based classification head.
• Accuracy: High accuracy multi-class classification.
• Input Size: Tokenized text with max length 512.
• Optimization: Cross-entropy loss with Adam optimizer.
🧠 Technical Advantages:
• Transformer Architecture: Self-attention mechanism for understanding contextual relationships in text.
• Pre-trained Weights: GPT-2 base model fine-tuned on news domain.
• Transfer Learning: Leveraging pre-trained language model representations.
• Multi-class Support: Classifies into World, Sports, Business, Sci/Tech categories.
📁 Model Files:
• Notebook: `02-ag-news-classification.ipynb`
• Dataset: Kaggle AG News Classification Dataset
• Framework: PyTorch, Transformers
Technical Stack
Sample Articles & Predictions

Example predictions from the model on test articles. The model correctly identifies news categories in articles with varying content, from simple headlines to complex news stories requiring contextual understanding.
Training & Validation Curves

The training curves show the model's learning progression over epochs. The loss decreases steadily while accuracy increases, reaching stable convergence. The validation metrics track closely with training, indicating good generalization without overfitting.
Classification Performance Matrix

The confusion matrix demonstrates the model's effectiveness in news category classification. It correctly identifies the four categories (World, Sports, Business, Sci/Tech) with high precision, making it reliable for real-world news categorization applications. The model achieves balanced performance across all categories.