Living Machines: A study of atypical animacy (2020)

Abstract: This paper proposes a new approach to animacy detection, the task of determining whether an entity is represented as animate in a text. In particular, this work is focused on atypical animacy and examines the scenario in which typically inanimate objects, specifically machines, are given animate attributes. To address it, we have created the first dataset for atypical animacy detection, based on nineteenth-century sentences in English, with machines represented as either animate or inanimate. Our method builds on recent innovations in language modeling, specifically BERT contextualized word embeddings, to better capture fine-grained contextual properties of words. We present a fully unsupervised pipeline, which can be easily adapted to different contexts, and report its performance on an established animacy dataset and our newly introduced resource. We show that our method provides a substantially more accurate characterization of atypical animacy, especially when applied to highly complex forms of language use.

## introduction animacy is the property of being alive. although the perception of a given entity as animate (or not) tends to align correctly with its biological animacy, discrepancies are not uncommon. these may arise from the ways different entities are unconsciously perceived, or from the deliberately figurative use of animate expressions to describe inanimate entities (or vice versa). machines sit at the fuzzy boundary between animacy and inanimacy @xcite . in this paper, we provide a basis for examining how machines were imagined during the nineteenth century as everything from lifeless mechanical objects to living beings, or even human-like agents that feel, think, and love. we focus on texts from nineteenth-century britain, a society being transformed by industrialization, as a good candidate for studying the broader issue. this paper applies state-of-the-art contextualized word representations, trained using the bert architecture @xcite , to animacy detection. in contrast to previous research, this paper provides an in-depth exploration of the ambiguities and figurative aspects that characterize animacy in natural language, and analyzes how context shapes animacy. context is constitutive of meaning @xcite ), an observation acknowledged by generations of scholars, but which is still difficult to apply to its full extent in computational models of language. we show how the increased sensitivity of bertbased models to contextual cues can be exploited to analyze how the same entity (e.g., a machine) can be at once represented as animate or inanimate depending on the intent of the writer. this paper makes several contributions: we present an unsupervised method to detect animacy that is highly sensitive to the context and therefore suited to capture not only typical animacy, but especially atypical animacy. we provide the first benchmark for atypical animacy detection based on a dataset of nineteenth-century sentences in english with machines represented as animate and inanimate. we conduct an extensive quantitative evaluation of our approach in comparison with strong baselines on both an established animacy dataset and on our newly introduced resource, and demonstrate the generalizability of our approach. finally, we discuss the distinction between animacy and humanness which, we believe, has the potential to shed light on the related (but separate) historical process of dehumanization through the language of mechanization, but which lies beyond the scope of the present paper. atypical observations are rare by definition. because of this, addressing them is often an ungratifying undertaking, as they can only marginally improve the accuracy of general natural language processing systems on existing benchmarks, if at all. and yet, precisely because of this, atypical observations tend to acquire a certain salience from a qualitative and interpretative point of view. for the humanities scholar and the linguist, such deviations prove particularly interesting objects of study because they flout expectations. ## related work animacy and its relation to (human) cognition has been extensively studied in a range of linguistic fields, from neurolinguistics and language acquisition research @xcite to morphology and syntax @xcite @xcite . there is evidence that animacy is not a fixed property of lexical items but is subject to their context @xcite . this points to a more nuanced and graduated view of animacy than a binary distinction between "animate" and "inanimate" @xcite , which results in a hierarchy of entities that reflects notions of agency, closeness to the speaker, individuation, and empathy @xcite @xcite . @xcite identifies modern machines as one of the most prominent examples at the frontier area between animacy and inanimacy. the distinction between animate and inanimate is a fundamental aspect of cognition and language, and has been shown to be a useful feature in natural language processing (nlp), in tasks such as coreference and anaphora resolution @xcite @xcite , word sense disambiguation @xcite , and semantic role labeling @xcite . earlier approaches to animacy detection relied on semantic lexicons (such as wordnet, fellbaum (1998)) combined with syntactic analysis @xcite , or developed machine-learning classifiers that use syntactic and morphological features @xcite . more recently, @xcite focused on dutch folk tales and trained a classifier to identify animate entities based on a combination of linguistic features and word embeddings trained using a skipgram model. they showed that close-to-optimal scores could be achieved using word embeddings alone. @xcite developed a hybrid classification system which relies on rich linguistic text processing, by combining static word embeddings with a number of hand-built rules to compute the animacy of referring expressions and co-reference chains. previous research @xcite has acknowledged the importance of context in atypical animacy, but it has not explicitly tackled it, or attempted to quantify how well existing methods have handled such complexities. whereas static word representations such as word2vec @xcite have been shown to perform well in typical animacy detection tasks, we argue that they are not capable of detecting atypical cases of animacy, as by definition this must arise from the context, and not the target entity itself. the emergence of contextualized word representations has yielded significant advances in many nlp tasks @xcite @xcite . unlike their static counterparts, they are optimized to capture the representations of target words in their contexts, and are more sensitive to context-dependent aspects of meaning. bert (bidirectional encoder representations from transformers, @xcite ) incorporates the latest improvements in language modeling. through its deep bidirectionality and self-attention mechanism, it has become one of the most successful attempts to train context-sensitive language models. bert is pre-trained on two tasks: masked language model (mlm), which tries to predict a masked token based on its left and right context, and next sentence prediction (nsp), which tries to predict the following sentence through a binary classification task. this dual learning objective ensures that the contextual representations of words are learned, also across sentences. its simple and efficient fine-tuning mechanism allows bert to easily adapt to different tasks and domains. ## method in this section, we describe our approach to determine the animacy of a target expression in its context. the intuition behind our method is the following: an entity becomes animate in a given context if it occurs in a position in which one would typically expect a living entity. more specifically, given a sentence in which a target expression has been adequately masked, we rely on contextualized masked language models to provide ranked predictions for the masked element, as shown in example 1: masked sentence: and why should one say that the [mask] does not live? predictions with scores: man (5.0788), person (4.4484), other (4.1866), child (4.1600), king (4.1510), patient (4.1249), one (4.1141), stranger (4.1067), ... we then determine the animacy of the masked expression foot_0 by averaging the animacy of the top κ tokens that have been predicted to fill the mask in the sentence. while this may initially seem to be a circular argument, the fundamentally probabilistic nature of language models means that we are in fact replacing the masked element with tokens that have a high probability of occurring in this context. our method rests on the assumption that, given a context requiring an animate entity, a contextualized language model should predict tokens corresponding to conventionally animate entities. we use a bert language model to predict a number of possible fillers given a sentence with a masked expression and their corresponding probability scores. we then use wordnet, foot_1 a lexical database that encodes relations between word senses @xcite , to determine whether the predicted tokens correspond to typically animate or inanimate entities. tokens can be ambiguous: the same token can be used for several different word senses, some of which may correspond to living entities and some others not. for example, the word 'dresser' has several meanings, including a profession -typically animate -and a piece of furniture -typically inanimate. we disambiguate each predicted token to its most relevant sense in wordnet by measuring the similarity between the original sentence and the gloss of each wordnet sense. inspired by previous research on distributional semantic models for word sense disambiguation @xcite , we use a bert-adapted version of the lesk algorithm, which adopts recent advancements in transformer-based sentence representations @xcite . wordnet organizes nouns according to hierarchies, which eventually converge at the root node entity. senses of nouns that correspond to living entities fall under the living thing node, which is the common parent of the person, animal, plant, and microorganism classes, among others. therefore, we determine whether each predicted token corresponds to an animate or inanimate entity based on whether its disambiguated sense is a descendant of the living thing node. 3 finally, we produce a single animacy score between 0 and 1 for the masked element, by averaging the animacy values (i.e. 0 if inanimate, 1 if animate) of the predicted tokens, weighted by their probability score. we find the optimal animacy threshold τ and cutoff κ (i.e. number of predicted tokens) through experimentation. 4 4 data we use two datasets to evaluate the performance of our algorithm: the first is derived from the data released by @xcite , while the second has been created by us for specifically testing detection of unconventional animacy, in nineteenth-century english texts in particular. both datasets are described in sections 4.1 and 4.2 respectively, and summarized and discussed in section 4.3. ## 0 ## language models in our experiments, we used the 'bert base uncased' model and tokenizer as contemporary model, 14 hereinafter referred to as bert-base. in addition, in order to investigate pattern changes over time, we 11 for us, 'animacy' encompasses 'humanness': all sentences that are tagged as cases of humanness are also annotated as animate, but not the other way around. the term 'humanness' is used differently in other research fields, for instance when evaluating the performance of a chatbot @xcite ). ## discussion and interpretation researchers across many disciplines have long debated the relation between language and the social worlds in which it exists. studying the linguistic depictions of machines as if they were alive raises important questions about the relationship between humans and machines that go beyond language. animacy and its related concept of agency @xcite are important markers of social and political power: when ascribed to non-human actors they indicate the shifting perception of human agency in distinction to that of machines. as discussed in section 4.2.2, we consider entities to be animate if they are given attributes and faculties that are characteristic of living entities; they are attributed humanness if they are portrayed as sentient and capable of specifically human emotions. 20 the latter is loosely tied to the idea of an anthropocentric hierarchy in animacy @xcite @xcite , which ranks entities most capable of human perception as the most animate, reflecting notions of agency, closeness to the speaker, or speaker empathy. all baselines and methods are clearly worse in predicting humanness than animacy. 21 in the case of the supervised baselines, this is possibly due in part to the very limited amount of annotated data for this concept (81 instances of animacy with humanness, 120 instances of animacy without humanness). besides, the lower agreement between annotators in detecting humanness (krippendorff α of 0.50) suggests that the task is more subjective. humanness most predicted tokens attributed man, woman, engine, person, child, dog, fellow, boy, machine, men negated man, men, soldier, horse, savage, coward, slave, woman, creatures, slaves language is not static, it evolves continuously @xcite . social and technological changes are paralleled by changes in the language used to describe them. in the nineteenth century, who or what was performing work was changing dramatically, with different groups of people entering and exiting the (free and unfree) labor pool and becoming key parts of the workforce at different times. @xmath0, and their hymn to labour was the only sound that broke the brooding silence. such changes are often implicitly captured by a language model. ## conclusion and further work we have introduced a new method for animacy detection based on contextualized word embeddings, which efficiently handles atypical animacy. our case study explores how machines were portrayed in nineteenth-century texts and is motivated by the ubiquitous trope of the living machine; both in the historical discourse of industrialization, and also in today's discussion of ai and robotics, prefigured by alan turing's famous provocation: 'can machines think?' @xcite . this work opens many avenues for future research. we intend to explore time-sensitive strategies to derive an animacy value from bert's predictions by inspecting the embedding space; study the contextual cues which grant animacy (and how these relate to the neighboring concepts of humanness and agency); and explore the extent to which such atypicalities are conveyed through figurative language. finally, we will apply all of the above in addressing the historical questions raised in this paper.