This project implements a sentiment analysis model using the Bag-of-Words (BoW) technique and logistic regression. The model is trained to classify text documents as either positive or negative sentiment.
Sentiment analysis is the process of determining the sentiment expressed in a piece of text, such as a review, tweet, or comment. In this project, we utilize the Bag-of-Words approach, which represents each document as a vector of word frequencies, and logistic regression to classify the sentiment of the text.
- Bag-of-Words Representation: Transforming text data into numerical vectors based on word frequency.
- Logistic Regression Model: A simple yet effective classification algorithm used for sentiment analysis.
- Flask Web Application: Deploy the trained model as a web service using Flask, allowing users to input text and receive sentiment predictions.
-
Clone the repository:
git clone https://github.com/Sujitmaurya123/sentiment-analyzer.git cd sentiment-analysis
-
Install the required dependencies:
pip install -r requirements.txt
-
Training the Model:
-
Prepare your dataset of text documents labeled with sentiment (positive or negative).
-
Run the training script to train the sentiment analysis model:
python train.py --data_path /path/to/dataset
-
-
Starting the Flask Web Application:
-
Launch the Flask web application to interact with the trained model:
python app.py
-
Access the web application at http://localhost:5000 in your web browser.
-
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- This project was inspired by [reference/source].
- Special thanks to [contributors], who contributed to the development of this project.
For any questions or inquiries, please contact [sujitkic6802maurya@gmail.com].