Skip to content

Less biased and more nuanced star rating generation from user reviews and comments

License

Notifications You must be signed in to change notification settings

ajskateboarder/wordsmyth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Wordsmyth logo

Wordsmyth

Wordsmyth eases the pains of manual comment analysis among content creators and users.

Instead of relying on star ratings given by the user, Wordsmyth generates them based on the text sentiment by applying pre-trained neural network results to deterministic rules. This combination of data analysis results in high-accuracy rating prediction that is mostly unbiased.

The goal of this model is not to reach high accuracy with consumer star ratings, but to act as a method for ratings to have more reliable ratings based on a set of standards.

Usage

Download the TorchMoji model locally:

curl https://www.dropbox.com/s/q8lax9ary32c7t9/pytorch_model.bin?dl=0 -L --output src/wordsmyth/data/pytorch_model.bin

Install your preferred version of PyTorch. Most people will go with the latest version, but 1.13.1+cpu seems to have the smallest package size:

pip install torch==1.13.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

Install wordsmyth:

pip install -e .

# comes with amazon review scraping for scripts
pip install -e ".[scraping]"

and use the module like so:

from wordsmyth import rate

rating = rate("Hello world")
print(rating, "stars") # 5 stars

rating, flags = rate("Hello world", flags=True)
print(flags) # [content flags ...]

There are also scripts to download reviews and benchmark this algorithm in scripts/. (they need some updating though)