Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/travelxml/tensorflow-and-keras-sentiment-analysis-using-rnn
NLP: Sentiment Analysis using TensorFlow and Keras: This project implements a Recurrent Neural Network (RNN) to classify Amazon product reviews into different sentiment categories. It leverages text preprocessing, tokenization, and model training to predict the sentiment with high accuracy.
https://github.com/travelxml/tensorflow-and-keras-sentiment-analysis-using-rnn
deep-learning deep-neural-networks deeplearning keras keras-tensorflow nlp rnn rnn-tensorflow sentiment-analysis tenserflow
Last synced: 14 days ago
JSON representation
NLP: Sentiment Analysis using TensorFlow and Keras: This project implements a Recurrent Neural Network (RNN) to classify Amazon product reviews into different sentiment categories. It leverages text preprocessing, tokenization, and model training to predict the sentiment with high accuracy.
- Host: GitHub
- URL: https://github.com/travelxml/tensorflow-and-keras-sentiment-analysis-using-rnn
- Owner: TravelXML
- Created: 2024-08-20T12:02:05.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-08-20T12:19:39.000Z (5 months ago)
- Last Synced: 2024-12-21T05:42:05.836Z (14 days ago)
- Topics: deep-learning, deep-neural-networks, deeplearning, keras, keras-tensorflow, nlp, rnn, rnn-tensorflow, sentiment-analysis, tenserflow
- Language: Jupyter Notebook
- Homepage:
- Size: 3.36 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TensorFlow and Keras: Sentiment Analysis Using RNN
This project uses advanced machine learning techniques to analyze the sentiment behind customer reviews. Specifically, it focuses on Amazon product reviews and determines whether a review is positive, negative, or somewhere in between. The goal is to predict the star rating of a review just by analyzing the text.
### What Is Sentiment Analysis?
Sentiment Analysis is a way of using computers to automatically figure out if a piece of text (like a product review) expresses a positive, negative, or neutral sentiment. For example, if someone writes "I love this product!", the sentiment is positive. If they write "This product is terrible," the sentiment is negative.
### What Is RNN?
Recurrent Neural Networks (RNN) are a type of artificial intelligence (AI) designed to understand sequences, like sentences or time-series data. RNNs are especially good at processing language because they can remember what has been said earlier in a sentence while interpreting the later parts.
### What Did We Do?
1. **Collected Data**: We used a dataset of Amazon product reviews, which includes both the text of the review and the star rating given by the customer.
2. **Processed the Text**: Before feeding the text to our model, we needed to clean it up and convert it into a form that the computer can understand. This involved:
- Breaking down the reviews into individual words (tokenization).
- Converting these words into numbers (since computers work with numbers).
- Making sure all reviews are the same length by padding them (adding zeros where necessary).3. **Built the Model**: We created an RNN model using TensorFlow and Keras. This model was designed to:
- Take in the processed text.
- Learn patterns that indicate whether a review is likely to have a high or low rating.
- Predict a rating (1 to 5 stars) for new reviews.4. **Trained the Model**: We fed the model thousands of reviews along with their ratings. The model used this data to learn how to predict ratings on its own.
5. **Tested the Model**: After training, we tested the model on new reviews that it hadn't seen before to see how well it could predict the correct rating.
6. **Made Predictions**: We created a simple function that allows you to input a new review, and the model will predict the star rating for that review.
## Getting Started
### Prerequisites
To run this project, you will need:
- A computer with Python installed.
- Basic knowledge of how to run Python scripts.
- TensorFlow and Keras libraries, which are used for building and running the AI model.### Installation
1. **Clone the Repository**: Download the project files from GitHub.
```bash
git clone https://github.com/TravelXML/TENSORFLOW-AND-KERAS-SENTIMENT-ANALYSIS-USING-RNN.git
cd TENSORFLOW-AND-KERAS-SENTIMENT-ANALYSIS-USING-RNN
```2. **Install Dependencies**: Install all the necessary Python libraries.
```bash
pip install -r requirements.txt
```### Running the Project
1. **Open the Jupyter Notebook**: This project is built using Jupyter Notebook, an easy-to-use interface for running Python code.
```bash
jupyter notebook rnn_az_senti_analysis.ipynb
```2. **Follow the Steps**: The notebook guides you through each step, from processing the data to training the model and making predictions.
3. **Make Predictions**: You can test the model with your own reviews by running the prediction function provided.
```python
rating = predict_review_rating("This product is fantastic!")
print(f"The predicted rating is: {rating}")
```### Example Output
- **Input**: "Worst product ever!"
- **Predicted Rating**: 1 star- **Input**: "Amazing quality, highly recommend!"
- **Predicted Rating**: 5 stars## Understanding the Results
After running the model, you’ll get predictions for the sentiment of reviews. The model will predict how many stars a review is likely to get based on the words it contains. This can be incredibly useful for businesses wanting to automatically sort or respond to customer feedback.
---
### A Few Simple Concepts:
- **Machine Learning**: Teaching a computer to recognize patterns in data.
- **Neural Network**: A computer system modeled after the human brain that learns from data.
- **Training**: The process of feeding data to a model so it can learn from it.
- **Prediction**: Using a trained model to guess outcomes on new, unseen data.Happy Coding!