File size: 2,949 Bytes
bbf7cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# IMDB Sentiment Analysis Project

## Overview

This project implements a sentiment analysis system for IMDB movie reviews using various machine learning and deep learning techniques. It includes a React frontend for user interaction and a Flask backend for processing and analyzing the reviews.

## Features

- Sentiment analysis of IMDB movie reviews
- Multiple machine learning models:
  - Naive Bayes (Gaussian NB)
  - Random Forest
  - Logistic Regression
  - LSTM
  - Transformer
- Interactive web interface for real-time analysis
- Visualization of model accuracies and dataset distribution
- User feedback system for continuous improvement

## Technologies Used

- Frontend: React, Recharts, Lucide React
- Backend: Flask, NLTK, SpaCy, scikit-learn, TensorFlow/Keras
- Data Processing: Pandas, NumPy
- Machine Learning: scikit-learn, TensorFlow, Keras
- Natural Language Processing: NLTK, SpaCy

## Setup Instructions

### Prerequisites

- Node.js and npm
- Python 3.7+
- Git

### Frontend Setup

1. Clone the repository:
   ```
   git clone https://github.com/saquib34/zensibleInterview.git
   ```
2. Navigate to the project directory:
   ```
   cd zensibleInterview
   ```
3. Install dependencies:
   ```
   npm install
   ```
4. Start the development server:
   ```
   npm start
   ```

### Backend Setup

1. Ensure you're in the project directory
2. Install required Python packages:
   ```
   pip install -r requirements.txt
   ```
3. Start the Flask server:
   ```
   python app.py
   ```

## Usage

1. Open your web browser and navigate to `http://localhost:3000` (or the port specified by your React setup)
2. Enter an IMDB movie review in the text input
3. Click "Analyze" to see the sentiment analysis results
4. (Optional) Provide feedback on the analysis accuracy

## Project Structure

- `/src`: React frontend source code
- `/public`: Public assets for the frontend
- `/backend`: Flask backend code
- `/models`: Trained machine learning models
- `/data`: Dataset and data processing scripts
- `requirements.txt`: Python dependencies
- `package.json`: Node.js dependencies

## Dataset

This project uses the IMDB Dataset of 50K Movie Reviews, available on Kaggle:
[IMDB Dataset](https://www.kaggle.com/datasets/lakshmi25npathi/imdb-dataset-of-50k-movie-reviews)

## Models and Performance

| Model               | Accuracy |
|---------------------|----------|
| Gaussian NB         | 0.7379   |
| Random Forest       | 0.7997   |
| Logistic Regression | 0.82     |
| LSTM                | 0.7424   |
| Transformer         | 0.5      |

## Contributing

Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes.

## License

[MIT License](LICENSE)

## Contact

Developer: Saquib
GitHub: [saquib34](https://github.com/saquib34)

## Acknowledgments

- IMDB for providing the dataset
- Kaggle for hosting the dataset
- All open-source libraries and tools used in this project