divyanshvats2004/movie-sentiment-analysis
0
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
- Install Requirements
pip install -r requirements.txt- Run Notebooks (Optional, to retrain) Launch Jupyter and run the notebooks sequentially:
jupyter notebook- Start the Web App
cd app
uvicorn app:app --reload --port 8000Open 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.
