This project is a sentiment analysis tool for movie reviews using machine learning. The model classifies reviews as positive or negative based on the text content.
This project uses a dataset of movie reviews to train a machine learning model that can predict the sentiment of new reviews. The project includes scripts for creating the dataset, training the model, and predicting sentiments.
- Python 3.x
- pip (Python package installer)
- Virtualenv (optional but recommended)
-
Clone the repository:
git clone https://github.com/yourusername/moviereview-sentiment-analysis.git cd moviereview-sentiment-analysis
-
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
-
On Windows:
.\env\Scripts\activate
-
On macOS/Linux:
source env/bin/activate
-
-
Install the required packages:
pip install -r requirements.txt
Run the script to create the dataset:
python create_dataset.py
This will generate a movie_reviews.csv
file with sample movie reviews and their sentiments.
Run the script to train the model and make predictions:
python test.py
Follow the prompts to enter your own movie reviews and get sentiment predictions.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes.
- Commit and push your changes to your fork.
- Create a pull request to the main repository.