See https://github.com/o-wth/politirate/tree/master/v3 for the monorepo.
- GraphQL JSON API
- tokenizers
- bindings from Rust to Python with RustPython, pyo3, or rust-cpython
- Python functions using 🤗 Transformers and torchMoji
- rayon for parallelism
A score dictionary is defined as a dictionary containing the various subscores for a single post.
/politicians
returns a list of U.S. politicians, where each politician is represented by a dictionary containing the name, the party, the state, Twitter username, etc./posts/<politician>
returns a list of all the politician's social media posts, from all platforms/score/<politician>
returns a politician's score, which is a function of their score dictionary over many dates, with more recent dates weighted more than older dates/history/<politician>
returns a dictionary of the format{date: score_dictionary}
- when a user makes a request to this route, we look in the MySQL database and
/posts/<politician>
to see if the politician has posted anything new since the last cache - if so, we recalculate the score for the politician's latest posts, returns this value to the user, and cache this value in the DB
- if there were no new posts since the last cache, we simply return the data in the DB
- when a user makes a request to this route, we look in the MySQL database and