Git Product home page Git Product logo

deliberative-politics's Introduction

Deliberative-politics

This repository contains the data and materials related to Twitter Deliberative Politics and the CLAPTON (Corpus for the Linguistic Analysis of Political Talk ONline) datasets of social media posts annotated for facets of discussion quality.

Dashboard for model inspection: https://share.streamlit.io/sriramelango/nus-political-discourse-quality/app.py

The dashboard is for illustrative purposes, and the text pre-processing may not exactly follow what was reported in the paper for the sake of speed. We are working on optimizing the dashboard to accurately reflect the models in the paper.

Models used in the dashboard: Are in the pickles folder

Other resources corresponding to this paper are at: https://osf.io/28esd/

Which variables to use? Please refer to the most recent results discussed at https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3870554

#################################################Folder structure data/trainingdata/jaidka.csv comprises the raw annotated data

supplement/codingscheme.docx describes the coding scheme

Each observation was labeled for each of the deliberative qualities with a 0, 1, or NULL depending on whether there was agreement between at least 3 if not 4 annotators out of 4 total annotators.

###################################################Variable names

message_id and message: an id and the text of the tweet relevance: see coding scheme, codes whether the tweet is relevant to politics.

positive: whether the tweet shows empathy and respect (note that "positive" means empathy and respect) uncivil: any kind of incivility, whether, abuse, threat, or exaggeration uncivil_abuse: incivility that is abusive (see coding scheme) uncivil_threat: incivility that involves threats (see coding scheme) uncivil_exag: incivility that involves exaggerated claims (see coding scheme) reciprocal: deliberation which involves a genuine question (supposed to encode engagement) justif: justification whether internal or external. justif_int: internal justification justif_ext: external justification const: constructiveness whether fact-checking, solution-finding, or common-ground-finding const_fact: constructiveness involving fact-checking behavior const_com: constructiveness involving common ground finding const_sol: constructiveness involving solution finding len: length of tweet (is not used as an iv)

########################References

Jaidka, K. (Under review). Talking politics: Building and evaluating data-driven lexica to measure political discussion quality. SSRN.

Jaidka, K. (2022). Developing a multilabel corpus for the quality assessment of online political talk. In Proceedings of the 13th language resources and evaluation conference (Vol. 13).

Jaidka, K., Zhou, A., & Lelkes, Y. (2019). Brevity is the soul of Twitter: The constraint affordance and political discussion. Journal of Communication, 69(4), 345-372.

deliberative-politics's People

Contributors

kj2013 avatar

Stargazers

Ashwin Rajadesingan avatar  avatar  avatar chainsawriot avatar ming ma avatar Segun Aroyehun avatar

Watchers

 avatar Audrey E. Brennan avatar

deliberative-politics's Issues

NameError: name 'transform_inputs' is not defined

In "03 - Generating labels on unlabeled data with trained models. ipynb", the following code includes an undefined function "transform_inputs".

def extract_tfidf_and_pos(df,X_col):
print("Loading other information...")
tf_vectorizer = joblib.load('final_tfidf_vectorizer.pkl')
idf_vector = joblib.load('final_idf_vectorizer.pkl')
pos_vectorizer = joblib.load('final_pos_vectorizer.pkl')
tweets = df[X_col]
X = transform_inputs(df[X_col], tf_vectorizer, idf_vector, pos_vectorizer)
featurenames = vectorizer.get_feature_names() + pos_vectorizer.get_feature_names()
df_tfidf = pd.DataFrame(tfidfs.toarray(), columns= featurenames)
df = df.join(df_tfidf)
return df

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.