CoolFace
Apppublic

divyanshvats2004/movie-sentiment-analysis

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

CineRead — Movie Sentiment Analyser

An end-to-end Machine Learning pipeline that scrapes IMDB movie reviews, trains a custom Bidirectional LSTM in PyTorch, and serves predictions via a beautifully designed FastAPI backend.

Project Structure

All data science and exploratory work is done cleanly inside Jupyter Notebooks (/notebooks), maintaining a robust separation from the production web deployment (/app).

  • —notebooks/01_Data_Collection.ipynb - BeautifulSoup scraper for IMDB data.
  • —notebooks/02_EDA_and_Preprocessing.ipynb - Data visualisztion, cleaning, and vocabulary building.
  • —notebooks/03_Model_Training_LSTM.ipynb - PyTorch Bidirectional LSTM architecture & training loop.
  • —app/ - The production FastAPI backend and Dark-Glassmorphism frontend.

Quickstart

  1. 1.Install Requirements
bash
pip install -r requirements.txt
  1. 1.Run Notebooks (Optional, to retrain) Launch Jupyter and run the notebooks sequentially:
bash
jupyter notebook
  1. 1.Start the Web App
bash
cd app
uvicorn app:app --reload --port 8000

Open http://localhost:8000 to interact with the premium CineRead UI.

Model Details

  • —Architecture: PyTorch Bidirectional LSTM (2 Layers). Unidirectional LSTMs only interpret words left-to-right. Using a Bi-LSTM ensures the network catches contextual subtleties (e.g., negations like "not as bad as it seems") by reading the sequence in both directions.
  • —Layers: 128-dim Embedding -> 256-dim Bi-LSTM -> Dropout(0.4) -> Linear output.