{'fraction_non_alphanumeric': 0.026305371046496284, 'fraction_numerical': 0.006202436985879558, 'mean_word_length': 5.150974025974026, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Towards a computational approach to literary text analysis

We consider several types of literary-theoretic approaches to literary text analysis; we describe several concepts from Computational Linguistics and Artificial Intelligence that could be used to model and support them.


Problem Statement
Consider the first sentence of the novel Finnegan's Wake (Joyce, 1939): riverrun, past Eve and Adam's, from swerve of shore to bend of bay, brings us by a commodius vicus of recirculation back to Howth Castle and Environs.
To computationally analyze this sentence as literature, we must understand that its meaning is more than the combination of its semantic components. The rubric of "who did what to whom, when, where, and why" will at best lead us only to understand that somewhere, probably in Ireland, a river is flowing.
Some obvious low-level tasks to improve our reading include: exploring the meaning of nonstandard capitalization and spacing, as in "riverrun"; resolving allusions, such as "Eve and Adam's," and considering the significance of variations from common phrasings 1; ; identifying alliterated phrases such as "swerve of shore" and "bend of bay" and considering their effect; recognizing tone shifts such as "commodius vicus of recircula-tion," and resolving any allusions they may indicate; identifying the significance of named entities such as "Howth Castle and Environs" 2 ; exploring the effect of the line's syntax on reception, as described by writing scholars (Tufte, 2006).
But becoming absorbed in these admittedly interesting questions threatens to distract us from the larger questions that literary theorists have been studying for over a century. Those questions include: • what interpretation is the "gold standard" by which others should be judged? Is it the meaning intended by the author? Is it the significance of the text to the readers (and if so, which readers?) Or is the meaning of a literary text inherent in how it takes part in a system and process of language use?
• what metrics can tell us whether one interpretation is better than another?
• how should we model the literary text as it relates to the larger body of language use, which includes both literary and nonliterary texts as well as everyday situated language use by intelligent agents? What features are necessary and sufficient to represent the way meaning (both literary and non-literary) is created and established among language-using populations? How is this meaning tied both to an intelligent agent's abstract beliefs as well as that agent's moment-to-moment understanding of its environment?
The wording of these questions is slanted to suggest their utility to computational linguistics. First, we may want to know how much of the meaning of a literary text comes from the author as opposed to from our situated interpretation of the text or from a language system 3 . Second, evaluation metrics would help us determine whether or not the performance of an automated literary system is improving. Finally, we would benefit from the explanations of a computational model of a literary text's meaning as it emerges from the situated reading of an authored artifact in the context of a multiagent language system; if nothing else, it would tell us how to design algorithms that both consume and produce literary artifacts in human-like ways.
However, these disparate research traditions consider questions closer to the low-level tasks described in Section 1 than to the theoretical questions of interpretation ranking, evaluation, and computational modeling of meaningful human lan-guage use. This is possibly because of the empirical methods which have become dominant in AI/CL in recent history (Cohen, 1995). A field whose methods are tuned to empirical evaluation will naturally shy from an area with few clear empirical tasks, whose humanities practitioners are likely to indulge in analyses assuming human levels of knowledge and language-processing capabilities.
Because of this we will turn instead for inspiration from the digital humanities (Schreibman, 2004). With its roots in humanities computing (Hockey, 2004) which constituted the earliest use of computers in the humanities, digital humanities took shape with the advent of the Internet. Digital humanities researchers currently apply computers to research questions such as authorship attribution (Jockers and Witten, 2010), statistical word-use analysis (Burrows, 2004), and the development of resources for classical lexicography (Bamman and Crane, 2009), often collaborating with statisticians or computer scientists. Digital humanities has always had detractors among more traditional humanities scholars, but scholars sympathetic to the overall goals of digital humanities have also critiqued some of its practices. Consider the technological constraints imposed by projects in which texts are digitized, annotated, and statistically analyzed. Those constraints make tacit assumptions about the objectivity of knowledge and the transparency of its transmission (Drucker, 2009). Those assumptions may be contrary to a literary theorist's understanding of how literary text analysis actually works.
For example, in the case of scholar/artist Johanna Drucker, knowledge is seen as partial, subjective, and situated. Subjectivity in this context has two components: a point of view inscribed in the possible interpretations of a work, and "inflection, the marked presence of affect and specificity, registered as the trace of difference, that inheres in material expressions" (Drucker, 2009). To Drucker, subjectivity of knowledge is evident in the fact that interpretation occurs in modeling, encoding, processing, and accessing knowledge.
Drucker's focus is on humanities tools in digital contexts rather than digital tools in humanities contexts. We will proceed in a similar spirit, considering the tasks and approaches of literary text analysis as practiced by literary theorists and considering what kinds of models and approaches from contemporary AI/CL research they might find useful, rather than starting with the tasks and approaches that AI/CL researchers are most familiar with and asking how they can be applied to literary text analysis.
As a specific goal to guide our thought, we will adopt a statement from another scholar who emphasizes the importance of keeping the humanities central to computational text analysis. In Reading Machines: Toward an Algorithmic Criticism, Stephen Ramsay develops the notion of adapting the constraints imposed by computation to intentionally create "those heightened subjectivities necessary for critical work" (Ramsay, 2011). While doing so, Ramsay states that from a humanist's perspective: Tools that can adjudicate the hermeneutical parameters of human reading experiences -tools that can tell you whether an interpretation is permissible -stretch considerably beyond the most ambitious fantasies of artificial intelligence.
The rest of this paper will attempt to respond to Ramsay's claim by developing such ambitious fantasies. We will strive to consider literary text analysis as it is understood by literary theorists of recent history, and we will describe how representative processes from each of these theories could be modeled computationally using techniques from the AI/CL research communities.

Expressive Realism
Human judgments on the nature of literature and the way literature is best read have changed frequently since classical times. The last century in particular has provided numerous, often contradictory, notions of how we should determine the meaning of a story, leaving us with no consensus. Even within a school of thought there may be significant differences of opinion, and evaluation is typically no more empirical than how persuasive the interpretation of a given text may be. Still, we may identify certain key ideas and use them to imagine ways they could involve computation.
We may begin by considering expressive realism, an approach to literary theory which developed in the late 19th and early 20th centuries, and is a combination of the classical Aristotelian notions of art as mimesis (reproducing reality) and the Romantic-era view of poetry as an outpouring of strong emotions produced by an artist whose percepts and affective processing are unusually well-tuned 4 (Belsey, 1980). The task of the reader in this formulation is to faithfully create in their minds the realities being represented by the work, and to enrich themselves by following the thoughts and feelings that the artist experienced.
Computationally, we may frame this as a knowledge engineering task: the writer is a subject matter expert in perceiving the world, and has developed knowledge about the world and innovative ways of emotionally relating to the world. The literary critic's task is to identify which writers have produced knowledge and affective relationships that are most worth adopting. The reader's task is to be guided by the critics to the best writers, and then strive to adopt those writers' knowledge and affective relations as their own.
It may seem difficult to perform such a task with a text such as Finnegan's Wake, which is not easy to translate into propositions. But consider a writer's understanding of what happens when reading expressive realist fiction (Gardner, 1991): If we carefully inspect our experience as we read, we discover that the importance of physical detail is that it creates for us a kind of dream, a rich and vivid play in the mind. We read a few words at the beginning of a book or the particular story, and suddenly we find ourselves seeing not only words on a page but a train moving through Russia, an old Italian crying, or a farmhouse battered by rain.
Gardner describes fiction as producing an immersive experience in which the reader's sensations are empathically aligned with those of the writer. This alignment produces an understanding unlike that of propositional knowledge: [The writer] at the very least should be sure he understands the common objection summed up in the old saw "Show, don't tell." The reason, of course, is that set beside the complex thought achieved by drama, explanation is thin gruel, hence boring. ... After our [reading] experience, which can be intense if the writer is a good one, we know why the character leaves when finally she walks out the door. We know in a way almost too subtle for words... The subtletly described by Gardner's explains how a text such as Finnegan's Wake may be read without recourse to a detailed exegesis producing propositional content. The reader need only become suggestible to the text, and allow themselves to experience the "complex thought" suggested by the writer. Of course, this "intense" experience may lead one to a further study of the writer's mind-set, which would then create an even fuller understanding of that writer's approach.
Such a description may seem like an unlikely candidate for computational modeling, but consider the neurolinguistic implications of models of the mirror neuron system (Rizzolatti and Craighero, 2004): hypothetically, a reader's neural structure might literally copy that of the writer's, provided the stimulus of the text. In this way we might model the transmission of knowledge "almost too subtle for words."

New Criticism
Later literary theories found expressive realism problematic in various ways. For example, the Anglo-American New Criticism defined the intentional fallacy, which states that "the design or intention of the author is neither available nor desirable as a standard for judging the success of a work of literary art" (Wimsatt and Beardsley, 1954) 5 . Wimsatt and Beardsley proposed to avoid "author psychology" by focusing on the internal evidence of the text, which they defined as public evidence which is discovered through the semantics and syntax of a poem, through our habitual knowledge of the language, through grammars, dictionaries, and all the literature which is the source of dictionaries, in general through all that makes a language and culture... The language knowledge and resources were used to identify the "technique of art". New Critic John Crowe Ransom provided examples of what devices should be used in analyzing poetry (Ransom, 1938): its metric; its inversions; solecisms, lapses from the prose norm of language, and from close prose logic; its tropes; its fictions, or inventions, by which it secures 'aesthetic distance' and removes itself from history... However, these devices were not studied for their own sake. Ransom continued: "the superior critic is not content with the compilation of the separate devices; the suggest to him a much more general question." The question in this case is "what [the poem] is trying to represent" and why it does so using those particular devices. This was worth understanding because the New Critics believed that "great works of literature are vessels in which humane values survive" (Selden and Widdowson, 1993) and which reinforce those values in the diligent reader.
Computationally, the list of language resources described by Wimsatt and Beardsley recalls the corpus-and knowledge-based resources promoted by textbook approaches to CL (Jurafsky and Martin, 2000). The low-level tasks in analyzing Finnegan's Wake described in Section 1 align with the New Critical identification of literary devices. Much of the CL/AI research described in Section 2 is in this vein.
However, to create a complete computational model of literary reading from this perspective we would also need a model of the types of "humane values" that New Critics revered. Unfortunately, the New Critics themselves did not explicitly provide such a model, as doing so was considered irrelevant. But we ourselves could adapt a computational model of culture to develop a representation of the New Critic's cultural values. AI researchers develop computational model of culture by, for example, implementing Cultural Schema Theory and Appraisal Theory in cognitive architectures to describe how culture emerges from an individual's cognitive processes (Taylor et al., 2007). There is room here to adapt the system of perceived affordances (Gorniak and Roy, 2006) in which language understanding is represented as the process of filtering real-world devices in a way analogous to how the New Critics filter literary devices.

Russian Formalism
The New Criticism developed independently of Russian formalism, which similarly focused on the text and the literary devices present, rather than the author's intentions or the context of the text's production. Because of this, most of the computational representations used in discussion of the New Critics could also be applied to the Russian formalists.
However, unlike the New Critics, the Russian formalists believed that art existed to create a sense of defamiliarization: art exists that one may recover the sensation of life; it exists to make one feel things... The technique of art is to make objects 'unfamiliar,' to make forms difficult, to increase the difficulty and length of perception because the process of perception is an aesthetic end in itself and must be prolonged. Art is a way of experiencing the artfulness of an object: the object is not important. 6 The defamiliarizing force of literature is easy to see in a text such as Finnegan's Wake, whose second sentence reads: Sir Tristram, violer d'amores, fr'over the short sea, had passencore rearrived from North Armorica on this side the scraggy isthmus of Europe Minor to wielderfight his penisolate war: nor had topsawyer's rocks by the stream Oconee exaggerated themselse to Laurens County's gorgios while they went doublin their mumper all the time: nor avoice from afire bellowsed mishe mishe to tauftauf thuartpeatrick: not yet, though venissoon after, had a kidscad buttended a bland old isaac: not yet, though all's fair in vanessy, were sosie sesthers wroth with twone nathandjoe. This is not a text that can easily be read rapidly. A more methodical reading is most obviously rewarded by the portmanteaux (which are created by combining words in new ways) along with the other literary devices. Computationally, as before this can be seen as another set of devices to be automatically processed. However it may be more productive to see this as an example of how writers strive to invent new devices and combine devices in new ways, which may be resistant to automated analyses. From this perspective, defamiliarization has its effect on the computational linguist who is developing the algorithms. The perception of the researcher is thus shifted and prolonged, creating in them a recovery of the sensation for language.

Structuralism and Post-Structuralism
Linguist Roman Jakobson was central figure in both Russian formalism and structuralism, two mutually influential schools of thought. A key difference between the two is their understanding of the relation between aesthetic products and their cultural context. To Russian formalists (as well as to New Critics), literary text existed apart from other cultural phenomena, whereas structuralism provided a formal framework which studied systems of arbitrary signs which could be built at different levels, (Schleifer, 1993) so that literary structures could be built with reference to cultural structures.
With roots in the semiotics of linguist Ferdinand de Saussure and of philosopher Charles Sanders Peirce, structuralism aimed at systematically uncovering the way that meaning arises from systems of signs forming linguistic elements such as sentences and paragraphs as well as higher levels of narrative discourse.
Continued scholarship on structuralism exposed a number of difficulties. Besides its lack of interest in individual cases or in the way systems change over time, the arbitrary nature of structuralist signs contradicted its aspirations to systematic representation (Schleifer, 1993). This was leveraged by philosopher Jacques Derrida, who argued that one could not study structures from "outside," in the way that an objective study requires.
Derrida was a post-structuralist, who used structuralism as a starting point but did not limit themselves with structuralism's constraints. Another post-structuralist, literary theorist Roland Barthes, used the phrase death of the author in a way reminiscent of the New Critics' intentional fallacy. Barthes, however, used the the arbitrariness of signs to go beyond the New Critics and reject the existence of any "ultimate meaning" of a text. Barthes saw the source of understanding as the reader: [A] text consists of multiple writings, issuing from several cultures and entering into dialogue with each other, into parody, into contestation; but there is one place where this multiplicity is collected, united, and this place is not the author, as we have hitherto said it was, but the reader... (Barthes, 1967) To Barthes, readers are not important in terms of their personal history or their state of mind, but rather that they are the one who "holds gathered into a single field all the paths of which the text is constituted." (Barthes, 1967) In other words, the text's meaning is dependent on the structures of signs in which the reader exists. And because signs are arbitrary, the reading produced by any reader must likewise be arbitrary, at least in terms of any objective measure of quality.
Another post-structuralist, psychologist Jacques Lacan, maintained that humans entered systems of signs in which they found or were provided roles, such as child/parent or male/female (Selden and Widdowson, 1993). This process is directed by the unconscious, and the only way it is able to take on comprehensible meaning is in expression through a system of language signs.
These are but a few of the influential structuralist and post-structuralist scholars, but they suffice to consider applicable computational techniques.
We begin by considering the concept of language as a complex adaptive system (Beckner et al., 2009). This provides a model that brings together language, interpretation, and intelligent agents (Steels, 2007) in a way that allows experiments with both sets of software agents and language-using robots (Steels, 2006). As in the structuralist view, meaningful language use is dependent on complex systems involving signification. But this complex system is made up of language-using agents, who must work together to determine norms as well as actually use language for real-world tasks and abstract reasoning. The model must work not only at the system level, but also at the individual level. CL/AI research in societal grounding (DeVault et al., 2006), dialogue grounding (Traum, 1994), semantic alignment (Pickering and Garrod, 2004), and relational agency (Bickmore and Picard, 2005) provide ways of representing how populations of agents use language meaningfully, and how pairs of human-like intelligent agents coordinate language in situated dialogues, while developing social relationships. As in the Lacanian subject, these agents are created or trained in terms of their difference or similarity from the other agents, adopting and being defined by their roles in the structured societies of agents.
When considering Finnegan's Wake, an intelligent agent would bring with it an algorithm for identifying features in stories, as well as resources such as language model data and its model of the role it fits in its social structures. Reading the text, the agent identifies literary devices that it uses as affordances to react with its emotions and its social perceptions, as well as to weigh the semantics of the text. When reading the text, the agent's interpretation of the story will be based on its gendered identity and personal history. In this way, the literary analysis of the agent is highly dependent on its sense of identity, as well as the localized nature of its language resources.

Conclusions
We began by describing some of the larger questions that literary theorists have been working with for over a century. We described some ideas from the digital humanities, including an expressed skepticism in artificial intelligence's ability to model human-like readings of literary texts. In response to that skepticism, we have described several major approaches to literary text analysis, and for each we have suggested ways in which state-ofthe-art CL/AI techniques could be applied to model or support their approach.
Of course this is by no means an exhaustive survey of either literary theoretical approaches or applicable CL/AI techniques. Rather, we are suggesting that a great number of possibilities remain unexplored between the two.