{'fraction_non_alphanumeric': 0.032472744298040264, 'fraction_numerical': 0.011738345261186542, 'mean_word_length': 4.8041537267080745, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Analysis of Nuanced Stances and Sentiment Towards Entities of US Politicians through the Lens of Moral Foundation Theory

The Moral Foundation Theory suggests five moral foundations that can capture the view of a user on a particular issue. It is widely used to identify sentence-level sentiment. In this paper, we study the Moral Foundation Theory in tweets by US politicians on two politically divisive issues - Gun Control and Immigration. We define the nuanced stance of politicians on these two topics by the grades given by related organizations to the politicians. First, we identify moral foundations in tweets from a huge corpus using deep relational learning. Then, qualitative and quantitative evaluations using the corpus show that there is a strong correlation between the moral foundation usage and the politicians’ nuanced stance on a particular topic. We also found substantial differences in moral foundation usage by different political parties when they address different entities. All of these results indicate the need for more intense research in this area.


Introduction
Over the last decade political discourse has shifted from traditional news outlet to social media. These platforms give politicians the means to interact with their supporters and explain their political perspectives and policy decisions. While formulating policies and passing legislation are complex processes which require reasoning over the pros and cons of different alternatives, gathering support for these policies often relies on appealing to peoples' "gut feeling" and invoking an emotional response (Haidt, 2001).
Moral Foundation Theory (MFT) provides a theoretical framework for analyzing the use of moral sentiment in text. The theory (Haidt and Joseph, 2004;Haidt and Graham, 2007) suggests that there are a small number of moral values, emerging from evolutionary, cultural and social reasons, which humans support. These are referred to as the moral foundations (MF) and include Care/Harm, Fairness/Cheating, Loyalty/Betrayal, Authority/Subversion, and Purity/Degradation. This theory was used to explain differences between political ideologies, as each side places more or less value on different moral foundations (Graham et al., 2009). Liberals tend to emphasize the Fairness moral foundation, for example, consider the following tweet discussing the 2021 mass shooting event in Colorado, focusing on how the race of the shooter changes the coverage of the event.
Liberal Gun Control tweet. Fairness @IlhanMN The shooter's race or ethnicity seems front and center when they aren't white. Otherwise, it's just a mentally ill young man having a bad day.
On the other hand, conservatives tend to place more value on Loyalty. The following tweet discusses the same event, emphasizing solidarity with the families of victims and the broader community.
Conservative Gun Control tweet. Loyalty @RepKenBuck My prayers are with the families of the victims of today's tragedy in Boulder. I join the entire community of Boulder in grieving the senseless loss of life. I am grateful for the officers who responded to the scene within minutes. You are true heroes.
In this paper, we study the relationship between moral foundation usage by politicians on social media and the stances they take on two policy issues, Gun Control and Immigration. We use the dataset provided by (Johnson and Goldwasser, 2018) for training a model for automatically identifying moral foundations in tweets. We then apply the model to a collection of 74k and 87k congressional tweets discussing the two issues -Gun Control and Immigration, respectively. Our analysis goes beyond binary liberal-conservative ideological labels (Preoţiuc-Pietro et al., 2017). We use a scale of 5 letter grades assigned to politicians by relevant policy watchdog groups, based on their votes on legislation pertaining to the specific policy issue. We analyze the tweets associated with the members of each group. Furthermore, we hypothesize that even when different groups use similar moral foundation, they aim to invoke different feelings in the readers. To capture these differences, we analyze the targets of the moral tweets by different groups. Our analysis captures several interesting trends. First, the proportion of non-moral tweets on both issues decreases as grades move from A (most conservative) to F (most liberal), while for the topic of Gun Control (Immigration), the proportion of Harm (Loyalty) tweets increases. Second, even when using the same moral foundation, their targets differ. For example, when discussing Gun Control, using the Loyalty moral foundation, liberal mostly mention march life, Gabby Gifford, while conservatives mention gun owner, Texas.

Related Works
The Moral Foundation Theory (MFT) (Haidt and Joseph, 2004;Haidt and Graham, 2007) has been proven to be useful in explaining social behaviour of humans (Mooijman et al., 2018;Brady et al., 2017;Hoover et al., 2020). Recent works have shown that political discourse can also be explained using MFT (Dehghani et al., 2014;Goldwasser, 2018, 2019). Existing works explain the political discourse mostly at issue and sentence level (Fulgoni et al., 2016;Xie et al., 2019) and at left-right polar domains of politics.
Several works have looked at analyzing political ideologies, beyond the left and right divide, using text (Sim et al., 2013;Preoţiuc-Pietro et al., 2017), and specifically using Twitter data (Conover et al., 2011;Johnson and Goldwasser, 2016;Mohammad et al., 2016;Demszky et al., 2019). To the best of our knowledge, this is the first work that studies whether MFT can be used to explain nuanced political standpoints of the US politicians, breaking the left/right political spectrum to nuanced standpoints. We also study the correlation between entity mentions and moral foundation usage by different groups, which helps pave the way to analyze partisan sentiment towards entities using MFT. In that sense, our work is broadly related to entity-centric affective analysis (Deng and Wiebe, 2015;Field and Tsvetkov, 2019;Park et al., 2020).
We use a deep structured prediction approach  to identify moral foundations in tweets by being motivated from the works that combine structured prediction with deep neural networks in NLP tasks (Niculae et al., 2017;Han et al., 2019;Liu et al., 2019;Widmoser et al., 2021).

Dataset
In this section, we describe the data collection process to analyze the US politicians' stances and sentiment towards entities on the topics -Immigration and Gun Control. First, we discuss existing datasets. Then, we create a topic specific lexicon from existing resource to identify topics in new data. Finally, we collect a large tweet corpus on the two topics using a lexicon matching approach.

Candidate Datasets
To study the nuanced stances and sentiment towards entities of politicians using MFT on the text they use, ideally, we need a text dataset annotated for moral foundations from US politicians with known political bias. To the best of our knowledge there are two existing Twitter datasets that are annotated for moral foundations -(1) The Moral Foundations Twitter Corpus (MFTC) by Hoover et al. (2020), and (2) The tweets by US politicians by Johnson and Goldwasser (2018). In MFTC, the moral foundation annotation is done in 35k Tweets on 7 distinct domains, some of which are not related to politics (e.g. Hurricane Sandy) and the political affiliations of the authors of the tweets are not known. The dataset proposed by Johnson and Goldwasser (2018) contains 93K tweets by US politicians in the years 2016 and 2017. 2050 of the tweets are annotated for moral foundations, policy frames (Boydstun et al., 2014) and topics. The dataset contains 6 topics including Gun Control and Immigration. We extend this dataset for these two topics by collecting more tweets from US Congress members using a lexicon matching approach, described in the next section.

Building Topic Indicator Lexicon
To build a topic indicator lexicon, we take the dataset proposed by Johnson and Goldwasser (2018). We build topic indicator lexicons for each of the 6 topics comprised of n-grams (n≤5) using Pointwise Mutual Information (PMI) scores (Church and Hanks, 1990). For an n-gram, w we calculate the pointwise mutual information (PMI) with topic t, I(w, t) using the following formula.
Where P (w|t) is computed by taking all tweets with topic t and computing count(w) count(allngrams) and similarly, P (w) is computed by counting n-gram w over the set of tweets with any topic. Now, we rank n-grams for each topic based on their PMI scores. We assign one n-gram to its highest PMI topic only. Then for each topic we manually go through the n-gram lexicon and omit any n-gram that is not related to the topic. In this manner, we found an indicator lexicon for each topic. The lexicons for the topics Gun Control and Immigration can be found in Appendix A. Note that, as a pre-processing step, n-grams were stemmed and singularized.

Tweet Collection
We use the large number of unlabeled tweets from US Congress members, written between 2017 and February, 2021 1 . We detect tweets related to the topics Gun Control and Immigration using lexicon matching. If a tweet contains any n-gram from the topic lexicons, we label the tweet with the corresponding topic. We take only the tweets on topics Gun Control and Immigration from the Democrat and Republican US Congress members for our study. Given the political affiliation of the authors of the tweets, this dataset is readily useful for the analysis of political stance and partisan sentiment. The details of the dataset is presented in Table 1. GUN

Identification of Moral Foundation in Tweets
To identify moral foundations in the collected dataset, we rely on a supervised approach using 1 https://github.com/alexlitel/congresstweets a deep relational learning framework. In this section, we first describe the model we use for the supervised classification. Then, we describe our training procedure and analyze the performance of our model on a held out set. Finally, we describe the procedure to infer moral foundations in the collected dataset using our model.

Deep Relational Learning For Moral Foundation (MF) Identification
For the identification of moral foundation (MF) in tweets, Johnson and Goldwasser (2018) rely on linguistic cues such as -political slogans, Policy Frames, Annotator's Rationale; along with party affiliation, topic and so on, while Johnson and Goldwasser (2019) models the behavioural aspects of the politicians in MF identification.
In both of the works they use Probabilistic Soft Logic for modeling. Some of the features used by Johnson and Goldwasser (2018) and Johnson and Goldwasser (2019) are hard to get for a large corpus and some require human annotation. Note that, in this section, our goal is not to outperform the state-of-the-art MF classification results, rather we want to identify MFs in the large corpus where only limited information is available. So, to identify MFs in our corpus we mostly rely on text and the information available with the unlabeled corpus such as, topics, authors' political affiliations and time of the tweets. We jointly model all of these features using DRaiL, a declarative framework for deep structured prediction proposed by  which is described below.

Modeling Features and Dependencies
In DRaiL, we can explicitly model features such as -tweet text, authors' political affiliations and topics using base rules as follows.
These rules correspond to base classifiers that map features in the left hand side of the ⇒ to the predicted output in the right hand side. For example, the rule, r 2 translates as "A tweet, t with authors' political affiliation, i has moral foundation label, m". We can also model the temporal dependency between two classification decisions using a second kind of rule, namely constraint as follows.
This constraint translates as "If two tweets have the same topic, are from the authors of the same political affiliation and are published nearly at the same time, then they have the same moral foundation". This constraint is inspired from the experiments done by Johnson and Goldwasser (2019).
In DRaiL, rules can be weighted or unweighted. We consider weighted version of the rules, making constraint c a soft-constraint as it is not guaranteed to be true all of the time. In DRaiL, the global decision is made considering all rules. It transforms rules into linear inequalities and MAP inference is then defined as an integer linear program: Here, rule grounding, r, generated from template, t, with input features, x r and predicted variables, y r defines the potential, ψ r (x r , y r ) where weights, w r are learned using neural networks defined over parameter set, θ. The parameters can be learned by training each rule individually (locally), or by using inference to ensure that the scoring functions for all rules result in a globally consistent decision (globally) using the structured hinge loss: Here, t is rule template, Φ t is the associated neural network, and θ t is the parameter set. y andŷ are gold assignments and predictions resulting from the MAP inference, respectively.
Neural Architectures Each base rule and the softconstraint is associated with a neural architecture which serve as weighting functions for the rules and constraints. For rules, r 1 , r 2 and r 3 , we use BERT (Devlin et al., 2019) to encode the tweet text. In rules r 2 and r 3 , we encode ideology and topic with a feed-forward neural network over their one-hot encoded form and we concatenate the encoded features with BERT representation of tweets to get a final representation for the rule. In all of the rules we use a classifier on top of the final representation that maps the features to labels. For the soft-constraint c, we encode the ideologies and topics in the left hand side of the constraint similarly and concatenate them and pass through a classifier to predict if the constraint holds or not.

Experimental Evaluation
We use the dataset proposed by Johnson and Goldwasser (2018) for this experiment. 2 We perform a 5-fold cross validation on 2050 tweets annotated for moral foundations. This is a 11 class classification task where there is one additional class, 'Non-moral' apart from the 10 moral classes. We experiment with the global learning of DRaiL using rules r 1 , r 2 , r 3 and soft constraint c. For the BERT (base-uncased) classifiers we use a learning rate of 2e −5 , batch size of 32, patience 10 and AdamW as optimizer. All of the tweets were truncated to a length of 100 tokens before passing through BERT. For constraint c we consider two tweets to be at the same time if they are published on the same day. All of the one-hot representations are mapped to a 100 dimensional space and ReLU and Softmax activation functions are used in all hidden and output neural units, respectively. The hyper-parameters are determined empirically. 3 We compare our model with two baselines as follows.
(1) Lexicon matching with Moral Foundations Dictionary (MFD) This approach does not have a training phase. Rather we use the Moral Foundation Dictionary (Graham et al., 2009) and identify moral foundation in a tweet using unigram matching from the MFD. A tweet having no dictionary matching is labeled as 'Non-moral'.
(2) Bidirectional-LSTM We run a bidirectional LSTM (Hochreiter and Schmidhuber, 1997) over the Glove (Pennington et al., 2014) word embeddings of the words of the tweets. We concatenate the hidden states of the two opposite directional LSTMs to get representation over one timestamp and average the representations of all time stamps to get the final representation of a tweet. We map each tweet to a 128-d space using Bi-LSTM and use this representation for moral foundation classification using a fully connected output layer. We use the same folds as the DRaiL experiments.
The classification results are summarized in Ta Table 3: Per class Moral Foundation classification results for the best model in Table 2 We present the per class statistics of the prediction of the best model in Table 3. We can see that mostly the classes with lower number of examples are harder to classify for the model (e.g. Cheating, Degradation). So, annotating more tweets on the low frequency classes may improve the overall performance of the model.

Inference on the Collected Corpus
Now, we train our best model (combining all base rules and the constraint in DRaiL) using the dataset we experiment with in Section 4.2. We, held out 10% of the data as validation set selected by the random seed of 42. We train the model using the hyper-parameters described in Section 4.2 and predict moral foundations in the tweets of the large corpus we annotated for the topics Gun Control and Immigration in Section 3. The validation macro F1 score and weighted F1 scores of the model were 49.44% and 58.30%, respectively. We use this annotated dataset to study nuanced stances and partisan sentiment towards entities of the US politicians.

Analysis of Politicians' Nuanced Stances
In this section, we analyze the nuanced stances of US politicians on the topics Gun Control and Immigration, using Moral Foundation Theory. First, we define nuanced political stances. Then we study the correlation between the moral foundation usage and nuanced political stances.

Nuanced Political Stance
Despite of being highly polarized, US politicians show mixed stances on different topics. For example, a politician may be supportive of gun prevention laws to some extent despite their party affiliation of the Republican Party. So, we hypothesize that the political stance is more nuanced than binary, left and right. We define the nuanced political stances of the politicians as the grades assigned to them by the National Rifle Association (NRA) 4 on Gun Control and by NumbersUSA 5 on Immigration. The politicians are graded in range (A+, A, . . . , F, F-) based on candidate questionnaire and their voting records by both of the organizations in the two different topics where A+ indicates most anti-immigration/pro-gun and F or F-indicates the most pro-immigration/anti-gun. In other words, A+ means extreme right and F/F-means extreme left and the other grades fall in between. We convert these letter grades in 5 categories: A, B, C, D, F. Here, A+, A and A-grades are combined in A and so on. We define these grades as nuanced stances of the politicians on the two topics.

Moral Foundation Usage
In this section, first, we study the political polarization, similar to Roy and Goldwasser (2020), in moral foundation usage by Democrats and Republicans on the two topics. Therefore, we rank the moral foundations by the frequency of usage inside each party. Then we plot the rank score of each moral foundation in Democrats and Republicans in x and y axes, respectively, where the most used moral foundation gets the highest rank score. Any moral foundation falling in the diagonal is not polarized and as far we go away from the diagonal it becomes more polarized. We show the polarization graphs for the two topics in Figure 1. It can be seen that the parties are polarized in moral foundation usage. The Republicans use 'Non-moral' and 'Authority' moral foundations in both of the topics. On the other hand, Democrats use 'Subversion' and 'Harm' on Gun Control and 'Loyalty' and 'Cheating' on Immigration. Now, we examine the moral foundation usage by the politicians from each of the grade categories. For that, we match the politicians with grades with our dataset and consider politicians tweeting at least 100 times on each topic. The statistics of politicians and corresponding tweets found for each grade is presented in Table 4  the moral foundation usage by each of the grade classes, we rank the moral foundations based on their usage inside each grade. Then we compare the rank of each grade class with the two opposite extremes (grades A and F) using Spearman's Rank Correlation Coefficient (Zar, 2005) where coefficient 1 means perfect correlation. As the grades B, C, D have fewer tweets, we sub-sample 500 tweets from each class and do the analysis on them. We repeat this process 10 times with 10 different random seeds and plot the average correlations in Figure  2. 6 It can be seen from the figures that the the correlations follow a progressive trend with the extreme left while moving from grade A to grade F and the trend is opposite with the extreme right, for both of the topics. This indicates that there is a correlation 6 Standard Deviations can be found in Appendix B.    in Appendix C. It can be seen from the figures that, as we move from grade A to F, the usage of 'Nonmoral' decreases for both of the topics, indicatingthe more conservative a politician is, they discuss the issues from a more 'Non-moral' perspective. On the other hand, more usage of 'Harm' and 'Loyalty' indicates more liberal stances on Gun Control and Immigration, respectively.

Analysis of Partisan Sentiment Towards Entities
In this section, we study the partisan sentiment towards entities by examining the usage of moral foundations while discussing the entities. First, we extract entities from the tweets, then we analyze the usage of moral foundations in the context of those entities by the two opposite parties.

Entity Extraction from Tweets
To study partisan sentiment towards entities we first identify entities mentioned in the tweets. We hypothesize entities to be noun phrases. So, we use an off-the-shelf noun phrase extractor 7 and extract noun phrases from the tweets. We filter out noun phrases occurring less than 100 times. Then we 7 https://textblob.readthedocs.io/ manually filter out noun phrases that are irrelevant to the topics (e.g. . In this manner, we found 64 and 79 unique noun phrases for Gun Control and Immigration, respectively. We treat these noun phrases as entities and run our analysis using these entities. The complete list of entities can be found in Appendix D

MF Usage in the Context of Entities
In this section, we analyze the partisan sentiment towards entities by looking at the moral foundation usage trend of the parties when discussing the entities related to the topics. For each party and each moral foundation we calculate the PMI score with each entity. We create 22 classes comprised of the 2 party affiliations and 11 moral foundation classes (e.g. Democrat-Care, Republican-Care and so on) and calculate the PMI scores as described in Section 3. We list the top-3 highest PMI entities for each moral foundation and each party in Table 5. We can see notable difference in moral foundation usage in the context of different entities by the two parties. For example, on the issue Immigration, the Democrats use 'Care' when addressing 'dreamers' and 'young people'. On the other hand, the Republicans use care in the context of 'border wall' and 'border patrol'. On the Law-abiding gun owners deserve the full protection of the U.S. Constitution when exercising their right to carry a concealed weapon -and that right should not end at a state line.
(8) Democrat Gun Control Gun Owner Fairness I am a hunter who believes in protecting the rights of law abiding gun owners. I am also a father of two young boys who believes there need to be changes in our gun laws. issue Gun Control, when talking about 'NRA' the Democrats associate 'Cheating' and 'Degradation', while the Republicans use 'Fairness'. These imply high polarization in partisan sentiment towards entities. We can see some interesting cases as well. For example, on Guns, the Republicans use 'Harm' with the entity 'police officer' and on Immigration, the Democrats use 'Harm' with 'migrant child'. On Guns, democrats and republicans sometimes use the same moral foundation in the context of the same entity. For example, both Democrats and Republicans use 'Fairness' in the context of 'Gun Owner' and 'Purity' in the context of 'tragic shooting'. So, we take a closer look at the usage of MFs in the context of these entities and list a few tweets discussing each of these entities in Table 6.
We can see that on Immigration, for Democrats, 'migrant child' is target of harm while 'detention facility' and 'Trump administration' are the entities posing the harm (examples (1), (2) in Table 6). So, even if the high-level moral foundation is the same, different participating entities in the text may have different partisan sentiments towards them.
On Guns, although the entity 'police officer' carries a positive sentiment for the Republicans across different moral foundations, the fine-grained sentiment towards this entity is different in the case of different moral foundations. For example, 'police officer' is the target of harm and is the entity providing care for the Republicans when used in the context of 'Harm' and 'Care', respectively (examples (3), (4) in Table 6). So, moral foundation can explain the sentiment towards entities beyond positive and negative categories.
In the context of 'Gun Owner', both of the parties use 'Fairness' in support of gun owners' rights, but they frame the issue differently -Democrats, by focusing on the need for more restrictions while preserving gun rights (example (8)) and Republicans, by focusing on the violation of constitutional rights if more restrictions are applied (example (7)). So, even if the moral foundation usage is the same, there is a framing effect to establish the corresponding partisan stances. While using 'Purity' in the context of 'tragic shooting', we found that both of the parties express their prayers for the shooting victims (example (5), (6)). Now, we find out the entities with highest disagreement between parties in moral foundation usage in context. To calculate the disagreement we rank the moral foundations based on frequency in usage by each party in the context of each entity. Then we calculate the Spearman's Rank Correlation Coefficient between these two rankings for each entity and list the top-10 entities with the highest disagreement in Table 7. Then we show the polarity graphs for one entity from each topic list in Figure 4. We can see that, on Gun, while discussing 'Amendment' the Republicans use 'Loyalty', although 'Loyalty' is not polarized towards the Re-publicans in aggregate (Figure 1). On the other hand, the Democrats use 'Cheating' in the context of 'Amendment'. Similarly, while discussing 'Donald Trump' on Immigration, the Democrats use 'Cheating' more, while the Republicans use 'Care' and 'Authority'. These analyses indicate that moral foundation analysis can be a useful tool to analyze partisan sentiment towards entities.

Future Work
In this section, we discuss some potential research directions that our analyses may lead to and their application in understanding political discourse.
Our experiments in Section 4 show that joint modeling of multiple aspects of the dataset (e.g. text, issue, and political affiliation) and the dependency among multiple decisions (e.g. temporal dependency), helps in classification. Incorporating other information such as linguistic cues, behavioural aspects, and so on, has the potential to improve the prediction furthermore. In general, incorporating information from multiple sources (e.g. social, textual) and modeling dependencies among decisions is an interesting future work that can help in the identification of the underlying intent of the text. So, this framework may be extended to similar tasks, such as political framing analysis, misinformation analysis, propaganda detection, and so on.
In Section 5, we found out that moral foundation usage can be useful in explaining the nuanced political stances of politicians beyond the left/right discreet categories. We observed that usage of some moral foundations strongly correlates with the nuanced stances of the politicians. While the stances of the extreme left (grade F) and extreme right (grade A) politicians are easy to explain, what are the stances of the politicians in the middle (grades B to D), is yet to be investigated qualitatively. This line of research would help in understanding the stance of the politicians at individual levels and has real-life implications. For example, understanding politicians' individual stances would help determine their future vote on legislative decisions and to identify the aisle-crossing politicians.
In Section 6, we found out clear cases where sentiment towards entities can be explained by grounding the Moral Foundation Theory at the entity level. This is an interesting direction where we can seek answers to several research questions, such as, (r1) What are the dimensions in a moral foundation category along which the sentiment towards the entities can be explained?; (r2) Can sentiment towards entities, inspired from moral foundations, explain political discourse?; (r3) Do the sentiment towards entities change over time and in response to real-life events? We believe our analyses will help advance the research in this direction.

Summary
In this paper, we study how Moral Foundation Theory (MFT) can explain nuanced political stances of US politicians and take the first step towards partisan sentiment analysis targeting different entities using MFT. We collect a dataset of 161k tweets authored by US politicians, on two politically divisive issues, Gun Control and Immigration. We use a deep relational learning approach to predict the moral foundations in the tweets, that models tweet text, topic, author's ideology, and captures temporal dependencies based on publication time. Finally, we analyze the politicians' nuanced standpoints and partisan sentiment towards entities using MFT. Our analyses show that both phenomena can be explained well using MFT, which we hope will help motivate further research in this area.