Skip to content

mohammadrezakarami/imdb-sentiment-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

IMDb Sentiment Classification

Sentiment classification project on the IMDb movie review dataset with a classical baseline and a transformer-based classifier.

Overview

This project studies binary sentiment classification on IMDb reviews. The workflow includes dataset loading, exploratory analysis, a TF-IDF plus logistic regression baseline, a BERT-based classifier, and artifact generation for model comparison and error analysis.

Main Setup

  • Dataset: imdb from Hugging Face Datasets
  • Task: binary sentiment classification
  • Baseline: TF-IDF + Logistic Regression
  • Main model: BERT sequence classification

Results Snapshot

  • Baseline accuracy: 0.8831
  • BERT evaluation accuracy: 0.8960
  • BERT evaluation F1: 0.8998
  • Improvement over baseline: 0.0129

Repository Contents

  • nlp-2.ipynb: main notebook covering EDA, baseline modeling, transformer training, and evaluation
  • artifacts/baseline_results.json: baseline metrics
  • artifacts/baseline_classification_report.txt: baseline classification report
  • artifacts/baseline_wrong_predictions.csv: baseline error examples
  • artifacts/bert_eval_results.json: transformer evaluation metrics
  • artifacts/bert_summary.json: summary of the BERT run
  • artifacts/bert_classification_report.txt: transformer classification report
  • artifacts/bert_wrong_predictions.csv: transformer error examples
  • artifacts/model_comparison.csv: comparison between the baseline and transformer setups

How To Use

  1. Create a Python environment.
  2. Install the required dependencies such as datasets, transformers, accelerate, evaluate, scikit-learn, pandas, numpy, matplotlib, seaborn, and nltk.
  3. Open nlp-2.ipynb in Jupyter.
  4. Run the notebook in order to reproduce dataset loading, baseline training, BERT fine-tuning, and evaluation.

Project Focus

  • sentiment analysis
  • IMDb reviews
  • classical vs transformer comparison
  • error analysis
  • reproducible evaluation artifacts

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors