Sentimental Analysis
Sentimental Analysis
Sentimental Analysis
sreejith.d@ktr.srmuniv.ac.in, devika.m@ktr.srmuniv.ac.in
2
Amtex Software Solutions Pvt. Ltd., Chennai – 603103, Tamil Nadu, India;
nagasantosh.t@live.com
3
Greenway Health, Florida, USA;
sanjumathew4293@gmail.com
Abstract
Objectives: Sentiment Analysis analyses people’s opinion, sentiments, attitudes and emotions towards entities such as
products, services, literature and their attributes. Since literature has got an exponential growth in digital format re-
cently, it will help the readers to choose the genre according to their interest as well. Methods/Statistical Analysis:
Finding and monitoring such opinions present in the Internet and filtering the required information is a formidable
task for an average reader because of the huge amount of data available online. In such difficult situations, Sentimental
Analysis can play a big role in helping the user. In this study, the sentiment analysis of a literary work is done using on-
tology of ‘Navarasa’. Findings: This study does, for the first time, the sentiment analysis of a short story using the
‘Navarasa’ ontology created by the researcher. The sentiment polarity of the work could be derived with a better accu-
racy using the emotion lexicons generated. Application/Improvements: Thus this paper provides a novel method of
sentiment analysis of English literature and throws light on new avenues for future research work in this domain.
Navarasa Ontology for the sentiment analysis of a short Austen’s novels could be used as pre-reading activity or
story from English Literature. In this ontology, OWL as a preliminary step in the interpretation of any literary
provides a machine readable ontology which can then be work.
processed by Semantic Web applications3.
The term ontology refers to a set of distinct objects
resulting from an analysis of a domain. “The main aim of
3. Methodology
ontology is to provide knowledge about specific domains
that can be understood by both, the computer and devel-
3.1 Navarasa
opers. It also helps to interpret a text review at a finger ‘Navarasa’ means nine emotions in which ‘nava’ signify
granularity with shared meanings and provides a sound nine and ‘rasa’ signifies emotions. The nine emotions
semantic ground of machine understandable description included in ‘Navarasas’ are Adbhuta Rasa (Wonder),
of digital context” (Haider, 10). Beebhatsa Rasa (Disgust), Bhayanaka Rasa (Terror),
Ontology consists of classes, the subsumption rela- Hasya Rasa (Comedy), Karuna Rasa (Pathos), Roudra
tions between them, object properties that relate to Rasa (Fury), Shanta Rasa (Quietism), Sringara Rasa
instances of classes, and restrictions on what properties (Eroticism) and Veera Rasa (Heroism). These are the
may hold for these instances. In a well-designed ontology, emotions that humans show according to the situation.
one can make inferences about classes and the types of All emotions and feelings are said to originate from
individuals. We used SPARQL to query our Rasa ontology these navarasas and by applying these nine flavors, we
to produce triples, i.e., subject, object and predicate, pres- discovered that it was possible to analyze the sentiment
ent in this ontology. SPARQL is an RDF query language nature of a literary work. For the purpose of this study,
which is used to retrieve and manipulate data stored in we utilized the concept of the navarasas as provided in
RDF files. For instance, ‘bewilderment has expression the Sanskrit text “SahithyaDarpana” (The Mirror of
horror’ is a ‘triples’, retrieved from this ontology by using Composition) which is considered to be one of the most
SPARQL Query. Here, ‘bewilderment’ is the subject and authentic texts on Indian Aesthetics4. Each ‘rasa’ has a
‘has expression horror’, the predicate. permanent mood and several accessories (fluctuating
moods). The term ‘expression’ in our ontology refers to
the various English words used in literature to express the
2. Problem Statement above mentioned ‘rasa’ as shown in the Table 1.
Sentiment Analysis or Opinion Mining refers to the In this research, we have tried to analyze the sentiment
application of Natural Language Processing to identify nature of an English short story by using Rasa-Oriented
and extract subjective information from source materi- Semantic Ontology. As the first requirement, we created
als. Its application can be seen in the area of product and the ontology of Navarasa. We drew the elements of this
movie reviews in social media. ontology from the Rasa concept in Indian Aesthetics. This
ontology asserted the classes and subclasses as well as the
2.1 Previous Research disjointedness of classes and its individuals. The scope of
the paper was restricted to the identification of the main
An analysis of nineteenth century novelist Jane Austen’s ontological elements of cases including classes, object
writing was compiled by KatrinOlmann as part of a uni- properties, class restrictions, and individuals; the whole
versity project which presented selected results from her ontology was more easily examined using the OWL file
study on irony in Austen’s writing complemented by find- and an ontology editor such as Protege. We aimed at
ings from some additional queries based on Jane Austen extracting a rich emotional semantics of tagged resources
Corpus (JAC) and a large corpus of 18th and 19th century through an ontology driven approach. This was done
English novels. According to Olmann, keywords in Jane by exploiting and combining available computational
2 Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology
D. Sreejith, M. P. Devika, Naga Santosh Tadikamalla and Sanju Varghese Mathew
and sentiment lexicons with ontology of emotional cat- 3.2 Ontology Generation
egories. We checked to see if the tags of a given resource
As the first part of the research, we created an ontology
are “emotion-denoting” words directly referring to some
of Navarasas (Nine Flavours) by using Protege 4.3 ontol-
emotional categories of the ontology5.The novelty of
ogy editor and knowledge base framework developed
this paper is the creation of a fuller, more explicit ontol-
by Stanford University. Protege is a free, open source
ogy of ‘navarasas’ which follow current methodologies
ontology editor and framework for building intelligent
of ontology design and presentation of the ontology in
systems. We provided graphical and textual representa-
rich, graphic and linguistic modes. And in the second
tions of the case, which served different presentational
part of the paper, we present how this ontology was used
purposes. In this navarasa ontology, rasa and expres-
for the sentimental analysis of a short story by using pro-
sions are the two main classes and rasa is further divided
grams like Java’s Apache Jena, SPARQL, Ruby and Python
into nine subclasses namely Adbhuta Rasa (Wonder),
Language.
Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology 3
Sentiment Analysis of English Literature using Rasa-Oriented Semantic Ontology
4 Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology
D. Sreejith, M. P. Devika, Naga Santosh Tadikamalla and Sanju Varghese Mathew
Beebhatsa Rasa (Disgust), Bhayanaka Rasa (Terror), if ‘horror’ is the expression of ‘Bhayanaka Rasa’, then it is
Hasya Rasa (Comedy) etc. In the category of ‘expres- inferred that it is the expression for the permanent mood
sions’, we employed under each ‘rasa’ the English words and all the accessory moods of Bhayanaka Rasa. Idioms
generally used in literature to express the corresponding and phrases have not been included within the scope of
emotion which is given as a member of that respective this ontology. They can however, be added later on, in
expression. We then specified the classes with respect to future ontological developments. The graphical represen-
the properties that define them. For example, one of the tation is given in Figure 2.
subsidiary moods of Sringara (Eroticism) is desolation.
This property defines the class. The ontology is shown in
Figure 1.
4. OWL to RDF/XML Conversion
In the ‘rasa’ class, each ‘rasa’ has one permanent mood After creating the Ontology, we converted the OWL for-
and several accessory moods which are given as members mat into RDF/XML using Java’s Apache Jena API. The
of that particular class. In a well-designed ontology, one purpose of converting into RDF/XML is to extract triples
can make inferences about classes and the types of indi- from the ontology since it doesn’t work in OWL as shown
viduals (i.e., the classes to which they belong); for example in Figure 3.
Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology 5
Sentiment Analysis of English Literature using Rasa-Oriented Semantic Ontology
6 Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology
D. Sreejith, M. P. Devika, Naga Santosh Tadikamalla and Sanju Varghese Mathew
NLTK (Natural Language Tool Kit) library. Python code 9. WEBSTER’S Dictionary
runs a loop through each emotion keyword producing
synsets as shown in Figure 5. In the initial stage of sentiment analysis using limited
emotion lexicons in our Rasa ontology, we felt the expres-
sions given in the ontology were not sufficient to analyze
8. Producing Relevant Synonyms the text. Hence, we decided to attach the ontology with
We filtered redundancies to obtain a list of relevant syn- Webster’s dictionary so that a greater number of words
onyms for each context of an emotion keyword present were available to detect the sentiment nature of the work
in the original list. That is, for each synset for an emotion as shown in Figure 6. We condensed the Webster’s dic-
keyword, we enlisted all relevant synonyms. tionary into a simple text file for assessing word validity.
Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology 7
Sentiment Analysis of English Literature using Rasa-Oriented Semantic Ontology
As shown in Figure 7. Conversion was done through pattern matching in Ruby language.
8 Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology
D. Sreejith, M. P. Devika, Naga Santosh Tadikamalla and Sanju Varghese Mathew
10. Word Variations mentation stage. With the emotion lexicons mapped to
the ‘Rasas’, we tried to identify the emotion keywords
As the next step, we generated all word variations of an present in the raw text9.
emotion keyword - adjectives, adverbs, verbs etc, by add-
ing suffixes and verifying with the condensed Webster’s
dictionary8. This was done in Ruby language and once a 12. Perform Analysis on
potential suffix was added, the Ruby script was used to Generated List of Emotion
check and see if the newly generated word existed in the Keywords
dictionary. If yes, it was added to the original emotion
lexicon. If not, it was discarded. Newly generated words This constituted the final part of our research. In this
were mapped to a particular Rasa and inserted back into stage the raw text was analyzed with respect to the emo-
emotion lexicon. tion keywords present and mapped with the respective
Rasas. We took a count of the number of words belonging
to each rasa. First we counted the emotion keywords of
11. Identify Emotion Keywords the raw text which belong to the ORIGINAL ontology list
Present in Raw Text of emotion keywords and gave them a score of 1. Then
we checked words that have come from the derived list
Once we were able to map the emotion lexicons to the
of emotion keywords. Those words were given a score of
‘Rasas’ given in the ontology, we proceeded to the imple-
0.75. An overall rasa score was generated by obtaining
Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology 9
Sentiment Analysis of English Literature using Rasa-Oriented Semantic Ontology
the sum of two. The percentage of a particular rasa was edge, knowledge acquisition and information retrieval
computed by comparing it with the total number of Rasa is facilitated. This ontology can also be used to analyze
words that have been identified as shown in the Figure 8 explicit details of the implicit mood of literary works.
and 9. Algorithm for assessment was done in Ruby script.
We made an attempt to analyze the short story ‘War’
written by Luigi Pirandello in order to find out how far
14. Future Work
the sentiment mood of the story corresponded with our This ontology can be expanded to include idioms and
newly created ‘navarasa’ ontology10. And the output says phrases which will enable its utilization in the genre of
that the predominant sentiment of this short story is literary criticism. In this paper, we have tried to detect
combinely Karuna Rasa ( sorrow) and ‘Bhayanaka Rasa’ the sentiment nature of a literary work by identifying the
(Terror) which are inter related and inter mixed in this emotional keywords associated with the various ‘rasas’. It
story. can be expanded to the analysis of all the elements of a
sentence by analyzing the neighboring words of the emo-
tion lexicon, pronouns, articles etc. This will enable us to
13. Conclusion
use Sentiment Analysis to perform literary criticism with
With this ontology as a standard representation of knowl- better accuracy.
10 Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology
D. Sreejith, M. P. Devika, Naga Santosh Tadikamalla and Sanju Varghese Mathew
Vol 10 (24) | June 2017 | www.indjst.org Indian Journal of Science and Technology 11