sentiment-analysis
Project Structure
- Sentiment_Analysis_Tool.ipynb: The Jupyter notebook that contains the complete code to build and test the sentiment analysis model.
- README.md: This file, containing the project description and instructions.
Steps Included
- Data Preprocessing: Cleansing of the text data, including removal of stop words and punctuation.
- Feature Extraction: Converting text data into numerical form using
CountVectorizer. - Model Building: Training a Naive Bayes classifier to predict the sentiment of customer feedback.
- Model Evaluation: Assessing the model's performance using accuracy and confusion matrix.
- Testing: Predicting sentiment for new customer feedback.
How to Use
- Clone this repository to your local machine.
- Open the
Sentiment_Analysis_Tool.ipynbin Jupyter Notebook or JupyterLab. - Run each cell step-by-step to execute the code and build the model.
- You can modify the sample feedback data or input new customer feedback to test the tool.
Example
Here’s how you can test the model with new feedback:
new_feedback = ["The product is great and I love it!"]
cleaned_new_feedback = [clean_text(feedback) for feedback in new_feedback]
new_feedback_vector = vectorizer.transform(cleaned_new_feedback)
# Predict sentiment
predicted_sentiment = nb.predict(new_feedback_vector)
print(f"Predicted sentiment: {predicted_sentiment[0]}")
Built With
- jupyter-notebook

Log in or sign up for Devpost to join the conversation.