Coder Social home page Coder Social logo

ajskateboarder / wordsmyth Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 91.33 MB

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

License: Apache License 2.0

Python 100.00%
nlp python ratings sentiment-analysis wordsmyth rule-based-nlp

wordsmyth's Introduction

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)

wordsmyth's People

Contributors

ajskateboarder avatar

Watchers

 avatar  avatar

wordsmyth's Issues

Todo

  • Introduce support for crawling major sites
    • Amazon
    • IMDB
    • YouTube
  • Create a fallback system for when rating fails (or provide exception at the least)
  • Rewrite `scripts/fetch_yt.py
  • Make web-friendly services apart from the library, but still in this repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.