Inducing Generalizable and Interpretable Lexica (2022)

Abstract: Lexica – words and associated scores – are widely used as simple, interpretable, generalizable language features to predict sentiment, emotions, mental health, and personality. They also provide insight into the psychological features behind those moods and traits. Such lexica, historically created by human experts, are valuable to linguists, psychologists, and social scientists, but they take years of refinement and have limited coverage. In this paper, we investigate how the lexica that provide psycholinguistic insights could be computationally induced and how they should be assessed. We identify generalizability and interpretability as two essential properties of such lexica. We induce lexica using both context-oblivious and context-aware approaches, compare their predictive performance both within the training corpus and across various corpora, and evaluate their quality using crowd-worker assessment. We find that lexica induced from context-oblivious models are more generalizable and interpretable than those from more accurate context-aware transformer models. In addition, lexicon scores can identify explanatory words more reliably than a high performing transformer with feature-importance measures like SHAP.

## introduction lexica -collections of words, often with associated weights -are widely used for interpretable models @xcite , particularly in psychology @xcite and other social sciences. lexica have been developed for areas as varied as sentiment and emotion @xcite , moral foundations @xcite , politeness @xcite , formality @xcite , concreteness and familiarity @xcite , and bilingual research @xcite . they are being created in hundreds of languages @xcite and are increasingly used to augment modern deep learning models @xcite . both supervised @xcite and unsupervised @xcite @xcite methods have been proposed, some with an emphasis on supporting interpretation @xcite @xcite . some most widely used lexica were created by human experts @xcite . however, these high-quality lexica often take years of refinement and have limited coverage. in comparison, computationally induced lexica are cheaper and lead to visible new insights provided by machine learning models for various corpora. in computer science, closely related to lexicon development is "feature importance", which also computes a strength of association between words and an outcome of interest to support interpretation. many methods have been used to extract feature importance from neural networks and other machine-learned models @xcite . one of the most popular of these measures is shap (shapley additive explanations) @xcite , a mathematically principled way of computing feature importances based on shapley values from game theory. different feature importances may serve different purposes, including "explaining the model" (i.e., showing why the model makes given predictions), versus "explaining the world" (i.e., providing insight into the data on which the model was trained and the world where that data was collected) @xcite . for example, when extracting feature importance from the sentence, "the food was pretty and tasty!", an attention-based model might show that the highest attention was given to the word "and", the words with the highest shapley values in a deep learned network might be "food" and "!", while a handcompiled list of positive and negative words might select "pretty" and "tasty". these different feature importance measurements provide different interpretations for the same prediction of the same model on the same input. the interpretations that "explain the model" are, in general, more "faithful" to the model, reflecting how the model uses each feature, while the ones that "explain the world" are more consistent with human intuition and reflect some consensus in the world. the two goals are not contradictory, but they have different priorities. in computer science research, feature importances are more often used to explain models. in contrast, social scientists such as psychologists use more expert-annotated lexica designed to explain the world. our goal is to computationally build lexica that explain the world, with the help of feature importance measurements. thus, our desirable lexica should solely be evaluated in terms of their faithfulness to the models. our primary goal is to provide insights into scientific questions using the lexicon analysis (e.g., "how are political parties getting more polarized?" or "when is empathy good or bad for people?"). instead of the faithfulness to the models, we identify generalizability and interpretability as key properties to assess the desirability of such lexica. generalizability is crucial to high-quality lexica. for example, widely used lexica, such as liwc @xcite , works well in an extremely broad set of corpora (used in over 10,000 papers). if a lexicon has the ability to explain emo-tion/sentiment in the real world, it should generalize well from one corpus (e.g., food reviews on yelp) to another (e.g., music lyrics). interpretability is even more important. the words in the lexicon should reflect what humans view as being important for explaining the emotion, personality, political orientation or other labels being predicted. to compare the degree of generalizability and interpretability of the lexica induced from contextaware or context-oblivious models and to gain insights into the lexica induction and assessment, we address the following four research questions (figure 1 ): in psychology, lexica such as liwc were created based on judgments of expert annotators @xcite . liwc is unweighted, and can be viewed as having a weight of one for all words in the lexicon. weighted lexica have also been created using crowdsourced annotations @xcite . recent work in computer science induces lexica using computational approaches @xcite . lexica can be generated by methods ranging from using linear regression coefficients to computing word scores by "inverting" feed-forward network @xcite . the word-level score can also be obtained using attention distributions or word frequency vectors. the extracted lexica have been applied to many tasks, including feature extraction @xcite , emotion prediction @xcite , linguistic analysis, or causal domain theories @xcite . although the term "lexicon" is often not explicitly mentioned, methods that compute the feature importance of words in machine-learned models produce lexica. these approaches generally use the coefficients from models or evaluate the impact of the features on the outputs by perturbing the inputs @xcite . for linear models, lexica can be constructed by directly using the coefficients or weights in the models. similarly, for non-linear models, people attribute to features by examining gradients, which can also be used to induce lexica @xcite . moreover, attention weights in more complex neural networks can serve the same function @xcite . attention provides some insights into certain types of models and tasks @xcite , but it is less clear whether it produces proper lexicon weights or faithful explanations @xcite . with the introduction of transformers @xcite , more complex context-aware models such as bert @xcite (and variations such roberta @xcite and distilbert @xcite ) often provide significantly better predictive performance. however, these developments present a larger challenge to interpret these more sophisticated models. on one hand, @xcite proposed integrated gradients (ig) for these differentiable models that examines the path integral of the gradients based on input baselines. on the other hand, we can also interpret the model as a black box, without the access to the gradients. by observing the impact on the predictions of some carefully designed perturbations for each word (e.g., via removal or masking) in the input, we can compute the importance of each work to the prediction @xcite . shap is an important example of such input perturbations @xcite . based on the shapley value from game theory, shap provides a class of approximations that evaluate the contributions of features in machine-learned models. partition shap is one of these approximations, that computes the shapley value for clustered features based on the partition trees, which provides a contextualized understanding of the input. many feature importance methods, such as marginal shapley values, are designed to "explain the model". the induced lexica thus contain words that help explain what models are computing, which are not necessarily the words that are important for understanding the world -the sentences and the people who produce them. for example, attention weights may focus on the word "and", rather than adjacent words. we prefer feature importance such as conditional shapley values that seek to "explain the world"; similarly, psychologists are also interested in lexica that "explain the world" to answer the questions like "what words typify empathetic people?" @xcite and "what does twitter language of people with adhd reveal about how they perceive the world?" @xcite . to date, there has been no broad assessment of the ability of induced lexica to "explain the world". @xcite compare feature importances across different models and feature importance metrics. however, the comparisons are based on the similarities of the most important features considered, and there is no metric to assess the quality of the lexica. @xcite provide an evaluation for the prediction interpretations in terms of plausibility and faithfulness. although a good lexicon should support plausible interpretations, we are more interested here in how a plausible lexicon (independent of a particular given model prediction) can be induced and assessed, and thus address a different task. bearing in mind how social scientists actually use lexica, we focus on evaluating the generalizability and interpretability of the lexica induced by different automated approaches. @xcite shows that some models provide similar explanations of the predictions regardless of the featureimportance metrics used. we, therefore, choose a set of popular models with differing levels of complexity and different accessibility to context, along with the suitable interpretations for each, and test them on diverse sentiment and emotion corpora. we work with sentiment and emotion since they are well-studied domains, allowing us to focus on the lexica induction insights. ## datasets our experiments induce lexica using a mixture of common broad-coverage datasets such as yelp foot_0 , amazon reviews @xcite , and nrc emotion @xcite . we use relatively tailored datasets such as sentiment treebank @xcite , emobank @xcite , emotionlines @xcite , daily dialog @xcite , and song lyrics @xcite , for evaluations of the lexica (in order to evaluate their generalizability to remote corpora). we will refer to the datasets used for lexica induction and evaluation as the "lexicon-induction datasets", and the ones used only for evaluation as the "evaluation datasets". for large datasets, we use their balanced subsets. the chosen datasets are from diverse sources, including twitter, song lyrics, newswire, online reviews, and crowdsourced writing. they vary by size, sentence length, and vocabulary size (for detailed dataset statistics see labels of all datasets are processed to be used for binary classifications. the datasets can be divided into two categories. the yelp and amazon datasets are for sentiment classification: the models classify reviews as positive or negative. for these datasets, we are interested in both the "heads" and "tails" (the words with the highest and lowest scores) of the resulting lexica, as they indicate positivity and negativity, respectively. for the nrc dataset, models do binary emotion classification for five different emotions (joy, fear, anger, sadness, and surprise). in these cases, we are only interested in the "head" of the lexica because those are the words most closely associated with the corresponding emotion. to allow fair comparisons, this work is done entirely in english; non-english words in the nrc datasets are filtered and removed. ## lexicon induction approaches the core of lexicon induction is the assignment of scores to each word, reflecting its semantics; we do this using the relative importance of the words in contributing to the label prediction. this requires deciding which predictive model and which feature importance measure to use. we explore different combinations of predictive models and means of computing feature importance as different approaches to create lexica. the models are trained to do text classification, and we select a set of sentiment and emotion tasks that are widely studied in order to yield the most insights. although models like bert use subwords as tokens, we compute only the word-level scores when inducing the lexica so that the lexica generated by different methods are comparable and the lexica are interpretable. these approaches are categorized based on the models' access to the context of the input text: context-oblivious approaches in which the sequence information and context in the input are lost (svm, ffn), versus context-aware approaches in which the sequence information is embedded in the representations and used for classification (lstm, roberta, and distilbert). the motivation for such categorization is that it remains unclear whether context would facilitate the creation of more generalizable and interpretable lexica (rq1 and rq3). ## evaluations and results the induced lexica are evaluated in terms of generalizability and interpretability, to address the four proposed research questions in section 1. examples of the induced lexica can be found in appendix c. ## conclusion comparing lexicon induction approaches based on various models -interpreted by different feature importance measures, and tested on various corpora -yields insights into what works best for inducing lexica and supporting interpretation. we observe that context improves model gen-eralizability, but not lexicon generalizability. the simpler context-oblivious models produce lexica with better generalizability: better predictive performances both within the training corpus and across different corpora. lexica induced using contextaware models lose the superiority in across-domain generalizability of context-aware models. when we induce lexica from the context-aware models, we lose the sequence information learned, as the lexica themselves are context-oblivious. that also leads to a surprising finding that, for contextoblivious models, linear classifiers using lexica scores do not show much performance drop compared to more complex models. lexica generated from context-oblivious models not only generalize better, but also align closer with human intuition. human evaluation shows that more words in lexica induced using contextoblivious models are considered reasonable than in lexica induced using context-aware models, regardless of whether the words are rare or frequent. we also find that the lexica generated from different context-oblivious models are correlated, while lexica generated from different context-aware models vary more. furthermore, lexicon scores can more reliably identify explanatory words in texts than featureimportance measures applied to transformer models.