Package: tracking-policy-agendas
A Frameword For Tracking Legislator's Policy AgendasThis repository contains the implementation for the following paper:Tracking Legislators’ Expressed Policy Agendas in Real TimeTable of ContentsTODOA Brief Summary of The PapersIntroductionMain ProblemIllustrative ExampleI/OMotivationRelated WorksContributions of this paperProposed MethodExperimentsImplementation detailsReproducing Results1) Tracking Legislators’ Expressed Policy Agendas in Real TimeTO-DO:Summarizing the paperOutlining the details of implementationsImplement Word2VecTraining Word2VecSeed wordsClassification headsResults & AnalysisTests&CoverageDocumentationCI/CDSmooth InstallationA Brief Summary of The PapersIntroduction:This work aims to analyse political orientation of legislators on salient policy issues through their temporally granular tweets, using a word embedding for feature extraction, and a classifier to label all legislators’ past and current relevant tweets according to whether they express a particular issue position over time.Main Problem:Is it possible to accurately analyse the temporal evolution of political orientation on salient issues by applying natural language processing techniques on users tweets?The issues of concern in this paper areimmigration, andclimate change.Illustrative Example:Given a tweet about immigration policy, they first encode it using word2vec enhanced dictionary, then its exclusiveness or inclusiveness can be detected using a classifier. Furthermore these results can be disaggregated to see whether it was posted from a Republican or a Democrat.I/O:Input: Tweets (textual modality)Output: Predicted stance on the salient political issueMotivation:Using tweets to track shifts in legislators’ rhetoric is highly scalable. It can be used on any topic of interest, by any political actor with a Twitter account, in any country around the world, from the past decade or into the future.Twitter data has high temporal granularity.Related (Previous) Works:According to legislator’s different channels of communications, it is divided into 8 categories:Stump speeches:Fenno 1978Campaign mail:Golbeck, Grimes and Rogers 2010Television advertising:Lau, Sigelman and Rovner 2007Floor speeches:Martin and Vanberg 2008;Martin 2011;Quinn et al. 2010Press releases:Grimmer 2010;Grimmer, Westwood and Messing 2014;Klüver and Sagarzazu 2016Websites:Adler, Gent and Overmeyer 1998;Anstead and Chadwick 2008;Druckman, Kifer and Parkin 2009RSS feeds:Cormack 2013Social media posts:Gulati and Williams 2010;Barbera et al. 2018;Radford and Sinclair 2016;Shapiro et al. 2014;Lilleker and Koc-Michalska 2013Contributions of this paper:Simple, transparent, and interpretable approach to tweet classification can achieve satisfactory levels of accuracy across diverse issues.Automate the process of updating and maintaining the model.Develop a dynamical, real-time scalable method for tracking elected officials’ expressed policy positions through their tweets.Proposed Method:Stage I: (Feature Extraction)They used Word2Vec enhanced dictionary to encode the texts. In particular, a set of stemmed seed words is identified as being relevant to the concept of interest. Then use word embeddings to identify other words that are semantically related to these seed words in the data.Stage II: Classification of political stance on salient issues.Choice of classifier: using five-fold cross validation and comparing precision, recall, accuracy, balanced accuracy, and F1 scores to choose the best performing classifier among XGBoost, Naive Bayes, Elastic Net, Lasso.Experiments:Datasets:Their own making. Crawled all senators and the vast majority of members of the House tweets using twitter API from any period of interest up to 2020, excluding those who left office or were elected for the first time.Results:Trained word embeddings on the entire corpus of legislators’ tweets. The word2vec dictionaries are limited to the 100 most similar words to the seed words and overly general or irrelevant terms are omitted.
The detailed results provided in the appendix is summarised in the below table:DatasetIssueClassification MethodF1-scoreRecallPrecisionAccuracyBalanced AccuracyCrawled Legislators' TweetsImmigration (Exclusive or Not)Naive Bayes0.8850.8530.9210.8130.738XGBoost0.8710.9090.8360.7950.668Elastic Net0.8810.9670.8090.8010.615Lasso0.8710.9620.7970.7840.586Immigration (Inclusive or Not)Naive Bayes0.8920.8650.9200.8300.781XGBoost0.8880.9160.8610.8280.746Elastic Net0.8900.9780.8170.8210.674Lasso0.8940.9740.8260.8280.691Climent Change (No Action or Not)Naive Bayes0.8890.8740.9040.8270.742XGBoost0.8880.8960.8800.8180.698Elastic Net0.8910.9630.8300.8110.575Lasso0.8920.9650.8300.8130.576Climent Change (Take Action or Not)Naive Bayes0.6870.7420.6400.7580.746XGBoost0.6780.6940.6620.7360.729Elastic Net0.7060.7640.6550.7450.748Lasso0.7000.7640.6460.7380.742Implementation details:Reproducing Results for XGBDatasetIssueClassification MethodF1-scoreRecallPrecisionAccuracyBalanced AccuracyCrawled Persian TweetsJCPOA (Relevant or Not)Naive Bayes0.8450.9010.7920.8430.839XGBoost0.9990.9990.9990.9990.999Passive Aggressive0.9910.9830.9940.9920.991Lasso0.9880.9850.9830.9840.987Stock Market (Relevant or Not)Naive Bayes0.8920.8650.9200.8300.781XGBoost0.9990.9991.0000.9990.999Elastic Net0.8900.9780.8170.8210.674Lasso0.8940.9740.8260.8280.691Vaccination (Relevant or Not)Naive Bayes0.8700.920.820.8550.883XGBoost1.0001.0001.0001.0001.000Passive Aggressive0.9750.9450.9650.970.95Lasso0.9710.9550.9730.9700.959Filtering (Relevant or Not)Naive Bayes0.6870.7420.6400.7580.746XGBoost0.9500.9510.9580.9540.950Elastic Net0.7060.7640.6550.7450.748Lasso0.7000.7640.6460.7380.742