Discovering influential text using convolutional neural networks (2024)

Abstract: Experimental methods for estimating the impacts of text on human evaluation have been widely used in the social sciences. However, researchers in experimental settings are usually limited to testing a small number of pre-specified text treatments. While efforts to mine unstructured texts for features that causally affect outcomes have been ongoing in recent years, these models have primarily focused on the topics or specific words of text, which may not always be the mechanism of the effect. We connect these efforts with NLP interpretability techniques and present a method for flexibly discovering clusters of similar text phrases that are predictive of human reactions to texts using convolutional neural networks. When used in an experimental setting, this method can identify text treatments and their effects under certain assumptions. We apply the method to two data sets. The first enables direct validation of the model’s ability to detect phrases known to cause the outcome. The second demonstrates its ability to flexibly discover text treatments with varying textual structures. In both cases, the model learns a greater variety of text treatments compared to benchmark methods, and these text features quantitatively meet or exceed the ability of benchmark methods to predict the outcome.

## introduction text impacts outcomes and decisions in many domains. for example, researchers have investigated the effects of campaign messaging on voting @xcite , post content on censorship @xcite , clinical notes on diagnoses and treatment @xcite , and written profiles on citizenship decisions (hainmueller and * these authors contributed equally to this work. hangartner, 2013). most experimental methods for estimating the effects of text on human evaluation randomly assign some subjects to a small number of treatment texts which are chosen ex-ante by the researcher. these treatments are often chosen subjectively, introducing the possibility that they may be ineffective or lack external validity. recent literature in computational social science has sought to instead discover treatments that have an effect on an outcome of interest from unstructured texts @xcite . in this work, we bridge these efforts towards making causal inferences using text treatments with the domain of interpretable machine learning @xcite . causal inference approaches with text as treatment aim to identify low-dimensional representations of text features that causally impact an outcome. we introduce an innovative application of contextualized word embeddings, convolutional neural networks (cnns), and interpretability methods to this setting to both detect and interpret these latent text representations. unlike previous approaches to identifying text treatments, these learned representations can vary in both length and structure and are not constrained to represent document-level sets of topics or sets of particular words. we apply our approach to two datasets: social media posts on weibo where the outcome is post censorship, and complaints submitted to the consumer financial protection bureau with the outcome of whether a complainant received a timely response. in both cases, our method extracts qualitatively different treatments and meets or exceeds quantitative performance metrics compared to benchmark methods. while this approach and those that it builds upon seek to simulate experiments that tar-get causal effects of specific latent text features, effects can only be identified directly under strong assumptions. alternatively, this model may be used as a tool for researchers to discover text treatments to test in subsequent confirmatory analyses, as an alternative to subjectively posing treatments. ## related work while much of the related social science work has focused on learning latent "features" of texts and using those as a treatment, most nlp work has focused on improving the interpretability of black-box predictive models. this paper bridges the two by using interpretability methods to flexibly discover latent treatments in text. ## extracting influential text from latent representations our goal is to extract clusters of phrases that represent latent, generalizable treatments that affect a particular outcome. to do this, we imagine that n texts (t i ) are randomly assigned to a process through which they are mapped to an outcome (y i ). let i also index the individual evaluating text i. we seek to identify and estimate the effect of an m-dimensional latent representation of those texts (z i ) which summarizes clusters of phrases or concepts that are likely to influence the outcome in repeated experiments. we refer to z i as "text treatments" for text i. for example, each element of z i could represent the presence or absence of a certain phrase or grammatical structure, with z @xmath0, 1} m . z i could also contain real-valued elements indicating continuous text features like similarity to a certain vocabulary or concept alignment. to simulate a sequential experimental setup, we follow @xcite in splitting our sample into training and test sets. we first train our model, using cross-validation within the training set for tuning and model selection. we then use the test data set to interpret the latent text treatments discovered and estimate their effects on the outcome under additional assumptions. our main contribution concerns this first stage: the novel usage of a cnn model to discover a mapping between text data and text treatments (z i ). fong and grimmer (2016, 2021) outline conditions under which this general process identifies causal effects of the text treatments on the outcome when treatments are binary. they assume that: 1) an individual's treatment depends only on their assigned text, 2) any nontextual features or latent text features not captured by the model which influence the evaluator's response (y i ) are independent from the model's captured latent features, 3) there is a nonzero probability of each evaluator receiving any of the possible text treatments (z i ), given unmeasured text features foot_0 , 4) texts are randomly assigned and 5) latent treatments are not perfectly collinear. if these assumptions hold, our model can identify treatment effects of the discovered latent features. these may be estimated using linear regression under the additional assumption that the m text treatments do not interact with each other, in addition to linear modeling assumptions in the case of continuous treatment variables. foot_1 how-ever, since it is difficult to assess whether these assumptions hold -particularly assumption 2 -we recommend that when possible, practitioners use our method to suggest treatments for study in a controlled experimental setting. ## methodology we propose harnessing the structure of cnns to identify influential text treatments. filters in convolutional layers project text phrases onto lower-dimensional representation spaces, and these representations are then max-pooled across all phrases within each sample to predict an outcome (figure 1 ). by training the model to produce predictive max-pooled representations, filters are incentivized to detect influential n-gram patterns @xcite . these patterns could correspond to specific keywords or clusters of keywords with similar vocabulary, grammatical structure, or tone, for example. researchers can then test how the presence of these patterns in texts affects the outcome. ## experiments in order to sufficiently demonstrate the qualitative and substantive results that are achievable with our method, we focus our experiments on two datasets. the first was selected because of rare access to ground-truth rationales underlying the text-driven outcome. the second was chosen to explore a setting where influential text features likely exhibit complex and varied structures and because of its use in closely related research. we take a depth versus breadth approach here, but future work should assess this method on a larger range of datasets. while the method can generalize to any dataset where text is thought to cause an outcome, datasets with ground-truth information about this relationship are ideal (though rare) for demonstrating successful identification of causal relationships and effects. ## conclusion we present a new method to discover influential text features represented by clusters of phrases of flexible length. our approach is inspired by and builds upon previous work in computational social science and interpretable nlp, and provides experimenters with a quantitative tool for identifying promising text treatments to test in follow up experiments. when researchers are willing to make stronger identification assumptions discussed in section 3, text treatments identified by using the model can also be used to estimate causal effects on the test set directly. our applications demonstrate the ability of our model to learn useful and diverse latent text representations and its capacity to recover known influential text features. important directions for future work include a human interpretability evaluation to rigorously compare the qualitative aspects of our method to benchmarks. approaches for evaluating the stability of identified latent text treatments across model runs would also be useful to practitioners performing follow-up controlled experiments.