Skip to content

A program to computer a positivity rating based on the sentiment in a sentence.

Notifications You must be signed in to change notification settings

nickimps/ReviewRater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReviewRater

Summary of Project

The purpose of this project is to research and create a prototype that can take in a product review, analyze it, and understand the sentiment behind it to determine whether it is a positive or a negative review. This project will provide a deeper understanding of the feeling a consumer has towards a product by using sentiment analysis to determine whether or not a consumer is satisfied with their purchase. This information can then be later used as feedback to make adjustments or improvements to a product or to gain an advantage when marketing to certain audiences. This program would have many uses, such as in a retail environment, specifically an internet platform, as it would improve how well a product has been reviewed and will give other consumers a more in-depth, accurate rating.

For example, a review on a product is provided that consists of points as to why the customer is satisfied with the product but because the packaging was damaged, the consumer gave it a negative review. The program would then take the review and perform sentiment analysis using natural language processing to determine whether the consumer found the product satisfactory and provide the review with an accurate number rating.

Installation

Install spaCy, version: 2.3.5

pip install -U spacy==2.3.5

Install the English Model for spaCy, version: 2.3.0

pip install -U https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz

Usage

The Following will Train and Test the TEST_REVIEW review

python ReviewRater.py train

The Following will just Test a single review that you will enter

python ReviewRater.py test single

The Following will just Test a dataset of reviews

python ReviewRater.py test batch

To Label Reviews For Training

The batches.zip contains 25 batches each containing 200 reviews, in .txt files.
The labelled.zip is a folder that contains a hierarchy of folders that will store the rating given to each one, there is a folder called one, two, etc..

  1. Download and unzip the batches.zip and the labelled.zip file into a folder.
  2. Download the labeller.py into the same folder.
  3. To run the labeller.py program:
    NOTE: you will need to change the file path in labeller.py to the current location on your PC, let me know if it still isnt working
python labeller.py

You will be prompted with a review and input. For the input enter the number of the rating you wish to give it, this will move it from the batch folder to the given folder in the labelled hierarchy. You can stop the program (CTRL + C) and resume later, it will not restart all the reviews - just whatever you have left.

About

A program to computer a positivity rating based on the sentiment in a sentence.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages