Skip to content

Command line program for recognising political views of Polish twitter accounts

Notifications You must be signed in to change notification settings

adam-handke/twitter-political-views-recogniser

Repository files navigation

Twitter political views recogniser

Python command line program for recognising political views of Polish Twitter accounts. Draws a 3-axis political compass for a given Twitter account based on last 1000 tweets of that account. Training data is based on public myPolitics test results and public Twitter accounts (last 1000 tweets of each user from the dataset). Loading tweets thanks to snscrape. Compass template based on SapplyValues.

myPolitics dataset

As we can see on the picture below, the data distribution is not balanced. Authoritarian and Conservative political views are underrepresented. It may be a result of less interest of people with such views in publishing their political compasses. It should be taken into account when analysing results.

Dataset compass

Requirements

Listed in file requirements.txt.

Running

Load tweets for training

python twitter_scraper.py

Train the models (one for each axis)

python political_views_recogniser.py -train

Get the most influential words in each model

python political_views_recogniser.py -most

Recognise political views of a twitter user

python political_views_recogniser.py [twitter_username]

Example

python political_views_recogniser.py szymon_holownia

Example compass

About

Command line program for recognising political views of Polish twitter accounts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages