Analyses of Literary Texts by Using Statistical Inference Methods
Authors: Mehmet Can Yavuz (Sabancı University, Kadir Has University, Bogazici University, 2019)
Topic: Sentiment, Emotion, Irony, Hate

Abstract
If a road map had to be drawn for Computational Criticism and subsequent Artificial Literature, it would have certainly considered Shakespearean plays. Demonstration of these structures through text analysis can be seen as both a naive effort and a scientific view of the characteristics of the texts. In this study, the textual analysis of Shakespeare plays was carried out for this purpose. Methodologically, we consecutively use Latent Dirichlet Allocation (LDA) and Singular Value Decomposition (SVD) in order to extract topics and then reduce topic distribution over documents into two-dimensional space. The first question asks if there is a genre called Romance between Comedy and Tragedy plays. The second question is, if each character’s speech is taken as a text, whether the dramatic relationship between them can be revealed. Consequently, we find relationships between genres, also verified by literary theory and the main characters follow the antagonisms within the play as the length of speech increases. Although the results of the classification of the side characters in the plays are not always what one would have expected based on the reading of the plays, there are observations on dramatic fiction, which is also verified by literary theory. Tragedies and revenge dramas have different character groupings.

Introduction
If a road map had to be drawn for Computational Criticism (Moretti, 2013) and subsequent Artificial Literature, it would have certainly considered Elizabethan drama. In particular, Shakespearean texts are the most outstanding examples of dramatic fiction. Demonstration of these structures through text analysis can be seen as both a naive effort and a scientific view of the characteristics of the texts. In this study, the textual analysis of Shakespeare plays was carried out for this purpose. To begin with, 'the First Folio' is the printed material in which all Shakespeare’s works are brought together for the first time, (Synder, 2001). The edition of 1623 was directed by two actors from the group called King’s Men. King’s Men is the ensemble that Shakespeare is also a member of. Half of the 36-play collection had never been published anywhere before. The Folio was also printed in Quarto form. These prints took their names from the way the books were folded. It is known that the First Folio has 800 prints, 233 of them have reached today. In the First Folio, Shakespearean plays are typically divided into three groups: Comedies, Tragedies, and Histories. Romance is the genre that hybridizes Comedy and Tragedy, developed at the beginning of the 17th Century. At the end of his career, he wrote four romances: Pericles, Cymbeline, The Winter’s Tale and The Tempest. 'The First Folio' groups Cymbeline with Tragedies; and The Winter’s Tale and The Tempest together with Comedies. The reason for this may be that The Winter’s Tale and The Tempest began as tragedies and then turned to comedies, and Cymbeline started as a comedy and ended as a tragedy. Shakespeare’s two tragedies Macbeth and Othello are two very good examples of a true tragedy and a revenge tragedy. Tragedies are designed as the struggle of the main characters and the opposing characters who create obstacles for the main character. The protagonist is generally the main character that the audience sympathizes with. Although not sympathetic, Macbeth is a protagonist and the opposing characters are antagonists: Duncan and Banquo. Similarly, there is also antagonism in revenge drama and the main theme is revenge. The antagonist or protagonist seeks revenge for an imaginary or real injury. Iago the antagonist gets his revenge provoking Othello, the protagonist, against his wife. Computerized analysis of literary texts, in other words computational criticism is a new and promising field, (Ramsay, 2011). Pioneering works aim to answer critical questions by using Natural Language Processing (NLP) methods. It is of interest to create fictional texts with the help of computer in the developing artificial literature along with these studies. In this study, we make a computational analysis of Shakespearean texts. There are basically two questions we’re trying to answer. The first is if the genres in Shakespeare’s theater texts can be classified by computer. Secondly, if the sentences in which the characters speak are taken as texts, can antagonisms be revealed? I tried to find answers to both with the same unsupervised learning technique. In recent years, NLP methods have been developing rapidly and text analysis methods are getting more advanced. Topic Modeling articles are among the top cited articles. An unsupervised topic modelling algorithm is used in this study. It is able to generate latent topics in which each document is a mixture. Having the latent topic distribution, by using dimension reduction algorithm, each document is mapped onto two dimensional coordinates without losing intrinsic characteristics.

Conclusion
The classification of genres shows us that the method we use provides successful quantitative information for the differentiation of genres. The length of the texts can be mentioned among the reasons for this success. Positioning the plays between Tragedy and Comedy is much discussed in the literature theory. The Romance genre hybridizes Tragedy and Comedy elements. Instead of mapping the Romance genre in between, the algorithm mapped four 'Problem Plays' in a region between Tragedies and Comedies. Another interesting finding is that Romance cannot be distinguished from Tragedies. The method used shows that the reason for some literary discussion is at the same time quantitative. The method classifies Romances within the Tragedies. In the light of theoretical discussions, of course, there may be a genre called Romance, but we have not been able to quantify this difference yet. There are also some results from our experiments on the two tragedies we have chosen. I intentionally choose a tragedy and a revenge play, although Macbeth clearly shows antagonisms. This is mainly due to the frequency of conversations within these clusters. For example, Macbeth and Lady Macbeth are always aware of each other’s true intentions. Dialogues within these clusters are always compatible with each other. Therefore, the cluster forms. There is a group subjectivity, also verified computationally. The war scene at the end of Macbeth can clearly be observable from the clusters. Two clusters to clash are formed throughout the play, which is quantifiable. On contrary, Iago who hides his true intention from everyone, has apparently always agreed with Othello. On the contrary, Iago never shares his intentions with anyone in the play. His intentions are shared through monologues. Thus, he could not form a cluster. He is a lonely character. That is why, the algorithm fails to find an antagonism. From this point of view, we can say that the method forms clusters of characters that agree with each other. The dramatic structure of revenge plays cannot be revealed by the method we proposed. Our method is successful when finding the clusters. We carried out a similar analysis for the play Hamlet, another type of revenge plays. Hamlet distinguished himself in a different cluster, as a lonely character with Lord Polonius who is responsible for spying on Hamlet. Lord Polonius is a similar character with Iago in terms of hiding their true intentions. The dramatic fiction in Shakespeare’s texts is shown to a certain extent. The advantage of the proposed pipeline is using non-linearity over a linear layer. Instead of directly clustering the document-term matrix, a powerful representation of each document in a feature space is generated by LDA. After generating document-topic matrix, a linear layer of dimension reduction, tSVD, that extracts principal directions or principal axes in which the document-topic matrix have the largest variance. I think that these naive efforts on the way to Artificial Literature also have a positive effect. The production of a play is possible with the knowledge of authorship for humans and even for Shakespeare. By authoring knowledge, we mean, for example, how to write a play from dramatic perspective. It is firstly introduced by Aristotle to shed light on present-day methods. It would be possible to reverse engineering them for artificial literature. Going from a quantitative analysis to plays would be possible. Therefore, as we analyze literary pieces, especially texts in dialogue form can help us verify critical questions and theories. From these analyses, going back to the literary text generation becomes possible.