<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Common-Sense Based API for Concept-Level Sentiment Analysis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Erik Cambria</string-name>
          <email>cambria@nus.edu.sg</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexander Gelbukh</string-name>
          <email>gelbukh@cic.ipn.mx</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Soujanya Poria</string-name>
          <email>sporia@ntu.edu.sg</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kenneth Kwok</string-name>
          <email>kenkwok@nus.edu.sg</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Center for Computing Research, National Polytechnic Institute of Mexico</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>School of Electrical &amp; Electronic Engineering, Nanyang Technological University</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Temasek Laboratories, National University of</institution>
          <country country="SG">Singapore</country>
        </aff>
      </contrib-group>
      <fpage>19</fpage>
      <lpage>24</lpage>
      <abstract>
        <p>The bag-of-concepts model can represent semantics associated with natural language text much better than bags-of-words. In the bagof-words model, in fact, a concept such as cloud_computing would be split into two separate words, disrupting the semantics of the input sentence. Working at concept-level is important for tasks such as opinion mining, especially in the case of microblogging analysis. In this work, we present Sentic API, a common-sense based application programming interface for concept-level sentiment analysis, which provides semantics and sentics (that is, denotative and connotative information) associated with 15,000 natural language concepts.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>http://sentic.net/api</p>
    </sec>
    <sec id="sec-2">
      <title>Algorithms</title>
    </sec>
    <sec id="sec-3">
      <title>Natural language processing; Sentiment analysis</title>
      <sec id="sec-3-1">
        <title>INTRODUCTION</title>
        <p>Hitherto, online information retrieval, aggregation, and
processing have mainly been based on algorithms relying on the textual
representation of webpages. Such algorithms are very good at
retrieving texts, splitting them into parts, checking the spelling and
counting the number of words.</p>
        <p>Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are not
made or distributed for profit or commercial advantage and that copies bear
tChoispnyoritigchetancd t2h0e1f4ullhceiltdatiboyn oanutheorfi(srs)t/powagnee.rC(so)p;ycroigphytisnfgorpceormmpiottneednts
oofntlhyisfowroprkrivoawtneeadnbdy aocthaedresmthiacnpAuCrpMosmesu.st be honored. Abstracting with
cPruedbiltisihsepderamsitpteadr.t Toof ctohpey#oMtheicrwroipseo,sotsr2r0e1p4ubWlisohr,ktsohpoopstpornocseeervdeinrsgos,r to
raevdaiisltarbibluete to listsa,sreCqEuUireRs pVroiol-r1s1p4e1ci(fihcttppe:r/m/icsesuiorn-wasn.do/orrg/aVfoele-. 1R1e4q1u)est
online
permissions from permissions@acm.org.
#Microposts2014, April 7th, 2014, Seoul, Korea.</p>
        <p>WWW’14 Companion, April 7-11, 2014, Seoul, Korea.</p>
        <p>Copyright 2014 ACM 978-1-4503-2745-9/14/04 ...$15.00.</p>
        <p>But when it comes to interpreting sentences and extracting
meaningful information, their capabilities are known to be very limited.
Machine-learning algorithms, in fact, are limited by the fact that
they can process only the information that they can ‘see’. As human
text processors, we do not have such limitations as every word we
see activates a cascade of semantically related concepts, relevant
episodes, and sensory experiences, all of which enable the
completion of complex tasks – such as word-sense disambiguation,
textual entailment, and semantic role labeling – in a quick and
effortless way. Machine learning techniques, moreover, are intrinsically
meant for chunking numerical data. Through escamotages such as
word frequency counting, it is indeed possible to apply such
techniques also in the context of natural language processing (NLP),
but it would be no different from trying to understand an image by
solely looking at bits per pixel information.</p>
        <p>Concept-level sentiment analysis, instead, focuses on a
semantic analysis of text through the use of web ontologies or semantic
networks, which allow the aggregation of conceptual and affective
information associated with natural language opinions. By
relying on large semantic knowledge bases, such approaches step away
from blind use of keywords and word co-occurrence count, but
rather rely on the implicit features associated with natural language
concepts. Unlike purely syntactical techniques, concept-based
approaches are able to detect also sentiments that are expressed in a
subtle manner, e.g., through the analysis of concepts that do not
explicitly convey any emotion, but which are implicitly linked to
other concepts that do so. The bag-of-concepts model can
represent semantics associated with natural language much better than
bags-of-words. In the bag-of-words model, in fact, a concept such
as cloud_computing would be split into two separate words,
disrupting the semantics of the input sentence (in which, for
example, the word cloud could wrongly activate concepts related to
weather).</p>
        <p>By allowing for the inference of semantics and sentics, the
analysis at concept-level enables a comparative fine-grained
featurebased sentiment analysis. Rather than gathering isolated opinions
about a whole item (e.g., iPhone 5S or Galaxy S5), users are
generally more interested in comparing different products according
to their specific features (e.g., iPhone 5S’s vs Galaxy S5’s
touchscreen), or sub-features (e.g., fragility of iPhone 5S’s vs Galaxy
S5’s touchscreen). In this context, the construction of
comprehensive common and common-sense knowledge bases is key for
feature-spotting and polarity detection, respectively.</p>
        <p>Common-sense, in particular, is necessary to properly
deconstruct natural language text into sentiments– for example, to
appraise the concept small_room as negative for a hotel review
and small_queue as positive for a post office, or the concept
go_read_the_book as positive for a book review but negative
for a movie review.</p>
        <p>The rest of the paper is organized as follows: Section 2 presents
available resources for concept-level sentiment analysis; Section 3
illustrates the techniques exploited to build the Sentic API;
Section 4 describes in detail how the API is developed and how it can
be used; Section 5 proposes an evaluation of the API; finally,
Section 6 concludes the paper and suggests further research directions.</p>
      </sec>
      <sec id="sec-3-2">
        <title>RELATED WORK</title>
        <p>
          Commonly used resources for concept-level sentiment analysis
include ANEW [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], WordNet-Affect (WNA) [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], ISEAR [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ],
SentiWordNet [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], and SenticNet [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. In [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], for example, a
conceptlevel sentiment dictionary is built through a two-step method
combining iterative regression and random walk with in-link
normalization. ANEW and SenticNet are exploited for propagating sentiment
values based on the assumption that semantically related concepts
share common sentiment. Moreover, polarity accuracy, Kendall
distance, and average-maximum ratio are used, in stead of mean
error, to better evaluate sentiment dictionaries.
        </p>
        <p>
          A similar approach is adopted in [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ], which presents a
methodology for enriching SenticNet concepts with affective information
by assigning an emotion label to them. Authors use various features
extracted from ISEAR, as well as similarity measures that rely on
the polarity data provided in SenticNet (those based on WNA) and
ISEAR distance-based measures, including point-wise mutual
information, and emotional affinity. Another recent work that builds
upon an existing affective knowledge base is [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], which proposes
the re-evaluation of objective words in SentiWordNet by
assessing the sentimental relevance of such words and their associated
sentiment sentences. Two sampling strategies are proposed and
integrated with support vector machines for sentiment classification.
According to the experiments, the proposed approach significantly
outperforms the traditional sentiment mining approach, which
ignores the importance of objective words in SentiWordNet. In [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ],
the main issues related to the development of a corpus for opinion
mining and sentiment analysis are discussed both by surveying the
existing work in this area and presenting, as a case study, an
ongoing project for Italian, called Senti-TUT, where a corpus for the
investigation of irony about politics in social media is developed.
        </p>
        <p>
          Other work explores the ensemble application of knowledge
bases and statistical methods. In [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ], for example, a hybrid
approach to combine lexical analysis and machine learning is
proposed in order to cope with ambiguity and integrate the context of
sentiment terms. The context-aware method identifies ambiguous
terms that vary in polarity depending on the context and stores them
in contextualized sentiment lexicons. In conjunction with semantic
knowledge bases, these lexicons help ground ambiguous sentiment
terms to concepts that correspond to their polarity.
        </p>
        <p>
          More machine-learning based works include [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], which
introduces a new methodology for the retrieval of product features and
opinions from a collection of free-text customer reviews about a
product or service. Such a methodology relies on a language
modeling framework that can be applied to reviews in any domain and
language provided with a seed set of opinion words. The
methodology combines both a kernel-based model of opinion words (learned
from the seed set of opinion words) and a statistical mapping
between words to approximate a model of product features from which
the retrieval is carried out.
3.
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>TECHNIQUES ADOPTED</title>
        <p>
          In this work, we exploit the ensemble application of spectral
association [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], an approximation of many steps of spreading
activation, and CF-IOF (concept frequency - inverse opinion frequency),
an approach similar to TF-IDF weighting, to extract semantics from
ConceptNet [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ], a semantic network of common-sense
knowledge. The extraction of sentics, in turn, is performed through the
combined use of AffectiveSpace [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], a multi-dimensional vector
space representation of affective common-sense knowledge, and
the Hourglass of Emotions [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], a brain-inspired emotion
categorization model.
3.1
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>Spectral Association</title>
        <p>Spectral association is a technique that involves assigning
activations to ‘seed concepts’ and applying an operation that spreads
their values across the graph structure of ConceptNet. This
operation transfers the most activation to concepts that are connected to
the key concepts by short paths or many different paths in
commonsense knowledge.</p>
        <p>In particular, we build a matrix C that relates concepts to other
concepts, instead of their features, and add up the scores over all
relations that relate one concept to another, disregarding direction.
Applying C to a vector containing a single concept spreads that
concept’s value to its connected concepts. Applying C2 spreads
that value to concepts connected by two links (including back to
the concept itself). As we aim to spread the activation through any
number of links, with diminishing returns, the operator we want is:
1 + C +</p>
        <p>C2
2!
+</p>
        <p>C3
3!
+ ... = eC</p>
        <p>
          We can calculate this odd operator, eC , because we can
factor C. C is already symmetric, so instead of applying Lanczos’
method [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] to CCT and getting the singular value decomposition
(SVD), we can apply it directly to C and get the spectral
decomposition C = V ΛV T . As before, we can raise this expression to
any power and cancel everything but the power of Λ. Therefore,
eC = V eΛV T . This simple twist on the SVD lets us calculate
spreading activation over the whole matrix instantly. We can
truncate this matrix to k axes and therefore save space while
generalizing from similar concepts. We can also rescale the matrix, so that
activation values have a maximum of 1 and do not tend to collect in
highly-connected concepts, by normalizing the truncated rows of
V eΛ/2 to unit vectors, and multiplying that matrix by its transpose
to get a rescaled version of V eΛV T .
3.2
        </p>
      </sec>
      <sec id="sec-3-5">
        <title>CF-IOF Weighting</title>
        <p>CF-IOF is a technique that identifies common topic-dependent
semantics in order to evaluate how important a concept is to a set
of opinions concerning the same topic. It is hereby used to feed
spectral association with ‘seed concepts’. Firstly, the frequency of
a concept c for a given domain d is calculated by counting the
occurrences of the concept c in the set of available d-tagged opinions
and dividing the result by the sum of number of occurrences of all
concepts in the set of opinions concerning d. This frequency is then
multiplied by the logarithm of the inverse frequency of the concept
in the whole collection of opinions, that is:</p>
        <p>CF -IOFc,d = Pk nk,d
nc,d
log X nk
k
nc
where nc,d is the number of occurrences of concept c in the set
of opinions tagged as d, nk is the total number of concept
occurrences and nc is the number of occurrences of c in the whole set of
opinions.</p>
        <p>A high weight in CF-IOF is reached by a high concept frequency
(in the given opinions) and a low opinion frequency of the concept
in the whole collection of opinions. Therefore, thanks to CF-IOF
weights, it is possible to filter out common concepts and detect
relevant topic-dependent semantics.
3.3</p>
      </sec>
      <sec id="sec-3-6">
        <title>AffectiveSpace</title>
        <p>To extract sentics from natural language text, we use
AffectiveSpace, a multi-dimensional vector space built upon ConceptNet and
WNA. The alignment operation operated over these two
knowledge bases yields a matrix, A, in which common-sense and
affective knowledge coexist, i.e., a matrix 15,000 × 118,000 whose rows
are concepts (e.g., dog or bake_cake), whose columns are either
common-sense and affective features (e.g., isA-pet or
hasEmotionjoy), and whose values indicate truth values of assertions.</p>
        <p>
          Therefore, in A, each concept is represented by a vector in the
space of possible features whose values are positive for features that
produce an assertion of positive valence (e.g., ‘a penguin is a bird’),
negative for features that produce an assertion of negative valence
(e.g., ‘a penguin cannot fly’) and zero when nothing is known about
the assertion. The degree of similarity between two concepts, then,
is the dot product between their rows in A. The value of such a dot
product increases whenever two concepts are described with the
same feature and decreases when they are described by features that
are negations of each other. In particular, we use truncated SVD
[
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] in order to obtain a new matrix containing both hierarchical
affective knowledge and common-sense.
        </p>
        <p>
          The resulting matrix has the form A˜ = Uk Σk VkT and is a
lowrank approximation of A, the original data. This approximation
is based on minimizing the Frobenius norm [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] of the difference
between A and A˜ under the constraint rank(A˜) = k. For the
Eckart–Young theorem [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] it represents the best approximation of
A in the least-square sense, in fact:
        </p>
        <p>min
A˜|rank(A˜)=k
|A − A˜|
=
=</p>
        <p>min
A˜|rank(A˜)=k</p>
        <p>min
A˜|rank(A˜)=k
|Σ − U ∗A˜V |
|Σ − S|
assuming that A˜ has the form A˜ = U SV ∗, where S is diagonal.
From the rank constraint, i.e., S has k non-zero diagonal entries,
the minimum of the above statement is obtained as follows:
min
A˜|rank(A˜)=k</p>
        <p>vu n
|Σ − S| = msiin tuXi=1 (σi − si)2 =
vu k
= min tuX (σi − si)2 +
si i=1
n
X
i=k+1
σi2 = uutv Xn</p>
        <p>σi2
i=k+1
Therefore, A˜ of rank k is the best approximation of A in the
Frobenius norm sense when σi = si (i = 1, ..., k) and the corresponding
singular vectors are the same as those of A. If we choose to
discard all but the first k principal components, common-sense
concepts and emotions are represented by vectors of k coordinates:
these coordinates can be seen as describing concepts in terms of
‘eigenmoods’ that form the axes of AffectiveSpace, i.e., the basis
e0,...,ek−1 of the vector space. For example, the most significant
eigenmood, e0, represents concepts with positive affective valence.
That is, the larger a concept’s component in the e0 direction is, the
more affectively positive it is likely to be. Thus, by exploiting the
information sharing property of truncated SVD, concepts with the
same affective valence are likely to have similar features – that is,
concepts conveying the same emotion tend to fall near each other
in AffectiveSpace.</p>
        <p>Concept similarity does not depend on their absolute positions
in the vector space, but rather on the angle they make with the
origin. For example we can find concepts such asbeautiful_day,
birthday_party, laugh and make_person_happy very
close in direction in the vector space, while concepts like sick,
feel_guilty, be_laid_off and shed_tear are found in a
completely different direction (nearly opposite with respect to the
centre of the space).
3.4</p>
      </sec>
      <sec id="sec-3-7">
        <title>The Hourglass of Emotions</title>
        <p>
          To reason on the disposition of concepts in AffectiveSpace, we
use the Hourglass of Emotions (Figure 1), an affective
categorization model developed starting from Plutchik’s studies on human
emotions [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ]. In the model, sentiments are reorganized around
four independent dimensions whose different levels of activation
make up the total emotional state of the mind. The Hourglass of
Emotions, in fact, is based on the idea that the mind is made of
different independent resources and that emotional states result from
turning some set of these resources on and turning another set of
them off [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
        </p>
        <p>The primary quantity we can measure about an emotion we feel
is its strength. But when we feel a strong emotion it is because
we feel a very specific emotion. And, conversely, we cannot feel
a specific emotion like ‘fear’ or ‘amazement’ without that emotion
being reasonably strong. Mapping this space of possible emotions
leads to an hourglass shape.</p>
        <p>In the model, affective states are not classified, as often happens
in the field of emotion analysis, into basic emotional categories, but
rather into four concomitant but independent dimensions,
characterized by six levels of activation, which determine the intensity of
the expressed/perceived emotion as a f loat ∈ [-1,+1]. Such
levels are also labeled as a set of 24 basic emotions (six for each of
the affective dimensions) in a way that allows the model to specify
the affective information associated with text both in a dimensional
and in a discrete form.
4.</p>
      </sec>
      <sec id="sec-3-8">
        <title>BUILDING AND USING THE API</title>
        <p>Currently available lexical resources for opinion polarity and
affect recognition such as SentiWordNet or WNA are known to be
pretty noisy and limited. These resources, in fact, mainly
provide opinion polarity and affective information at syntactical level,
leaving out polarity and affective information for common-sense
knowledge concepts like celebrate_special_occasion,
accomplish_goal, bad_feeling, be_on_cloud_nine,
or lose_temper, which are usually found in natural language
text to express viewpoints and affect.</p>
        <p>
          In order to build a comprehensive resource for opinion mining
and sentiment analysis, we use the techniques described in
Section 3 to extract both cognitive and affective information from
natural language text in a way that it is possible to map it into a fixed
structure. In particular, we propose to bridge the cognitive and
affective gap between word-level natural language data and their
relative concept-level opinions and sentiments, by building
semantics and sentics on top of them (Figure 2). To this end, the Sentic
API provides polarity (a float number between -1 and +1 that
indicates whether a concept is positive or negative), semantics (a set of
five semantically-related concepts) and sentics (affective
information in terms of the Hourglass affective dimensions) associated with
15,000 natural language concepts. This information is encoded in
RDF/XML using the descriptors defined by Human Emotion
Ontology (HEO) [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
4.1
        </p>
      </sec>
      <sec id="sec-3-9">
        <title>Extracting Semantics</title>
        <p>The extraction of semantics associated with common-sense
knowledge concepts is performed through the ensemble application of
spectral association and CF-IOF on the graph structure of
ConceptNet. In particular, we apply CF-IOF on a set of 10,000 topic-tagged
posts extracted from LiveJournal1, a virtual community of more
than 23 million who are allowed to label their posts not only with
a topic tag but also with a mood label, by choosing from more than
130 predefined moods or by creating custom mood themes.</p>
        <p>Thanks to CF-IOF weights, it is possible to filter out common
concepts and detect domain-dependent concepts that individualize
topics typically found in online opinions such as art, food, music,
politics, family, entertainment, photography, travel, and
technology. These concepts represent seed concepts for spectral
association, which spreads their values across the ConceptNet graph. In
particular, in order to accordingly limit the spreading activation of
ConceptNet nodes, the rest of the concepts detected via CF-IOF are
given as negative inputs to spectral association so that just
domainspecific concepts are selected.
4.2</p>
      </sec>
      <sec id="sec-3-10">
        <title>Extracting Sentics</title>
        <p>
          The extraction of sentics associated with common-sense
knowledge concepts is performed through the combined use of
AffectiveSpace and the Hourglass model. In particular, we discard all
but the first 100 singular values of the SVD and organize the
resulting vector space using a k-medoids clustering approach [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ], with
respect to the Hourglass of Emotions (i.e., by using the model’s
labels as ‘centroid concepts’).
        </p>
        <p>By calculating the relative distances (dot product) of each
concept from the different centroids, it is possible to calculate its
affective valence in terms of Pleasantness, Attention, Sensitivity and
Aptitude, which is stored in the form of a four-dimensional vector,
called sentic vector.
4.3</p>
      </sec>
      <sec id="sec-3-11">
        <title>Encoding Semantics and Sentics</title>
        <p>In order to represent the Sentic API in a machine-accessible and
machine-processable way, results are encoded in RDF triples
using a XML syntax (Figure 3). In particular, concepts are
identified using the ConceptNet Web API and statements are encoded in
RDF/XML format on the base of HEO. Statements have forms such
as concept – hasPlesantness – pleasantnessValue, concept –
hasPolarity – polarityValue, and concept – isSemanticallyRelatedTo –
concept.</p>
        <p>Given the concept celebrate_special_occasion, for
example, the Sentic API provides a set of semantically related
concepts, e.g., celebrate_birthday, and a sentic vector
specifying Pleasantness, Attention, Sensitivity and Aptitude associated
with the concept (which can be decoded into the emotions of
ecstasy and anticipation and from which a positive polarity value can
be inferred).</p>
        <p>Encoding semantics and sentics in RDF/XML using the
descriptors defined by HEO allows cognitive and affective information to
be stored in a Sesame triple-store, a purpose-built database for the
storage and retrieval of RDF metadata. Sesame can be embedded
in applications and used to conduct a wide range of inferences on
the information stored, based on RDFS and OWL type relations
between data. In addition, it can also be used in a standalone server
mode, much like a traditional database with multiple applications
connecting to it.
4.4</p>
      </sec>
      <sec id="sec-3-12">
        <title>Exploiting Semantics and Sentics</title>
        <p>Thanks to its Semantic Web aware format, the Sentic API is
very easy to interface with any real-world application that needs
to extract semantics and sentics from natural language. This
cognitive and affective information is supplied both at category-level
(through domain and sentic labels) and dimensional-level (through
polarity values and sentic vectors).</p>
        <p>Sentic labels, in particular, are useful in case we deal with
realtime adaptive applications (in which, for example, the style of an
interface or the expression of an avatar has to quickly change
according to labels such as ‘excitement’ or ‘frustration’ detected from
user input). Polarity values and sentic vectors, in turn, are useful for
tasks such as information retrieval and polarity detection (in which
it is needed to process batches of documents and, hence, perform
calculations, such as addition, subtraction, and average, on both
conceptual and affective information).</p>
        <p>Averaging results obtained at category-level is also possible by
using a continuous 2D space whose dimensions are evaluation and
activation, but the best strategy is usually to consider the
opinionated document as composed of small bags of concepts (SBoCs) and
feed these into the Sentic API to perform statistical analysis of the
resulting sentic vectors.</p>
        <p>To this end, we use a pre-processing module that interprets all the
affective valence indicators usually contained in text such as
special punctuation, complete upper-case words, onomatopoeic
repetitions, exclamation words, negations, degree adverbs and
emoticons, and eventually lemmatizes text.</p>
        <p>
          A semantic parser then deconstructs text into concepts using a
lexicon based on ‘sentic n-grams’, i.e., sequences of lexemes which
represent multiple-word common-sense and affective concepts
extracted from ConceptNet, WNA and other linguistic resources. We
then use the resulting SBoC as input for the Sentic API and look
up into it in order to obtain the relative sentic vectors, which we
average in order to detect primary and secondary moods conveyed
by the analyzed text and/or its polarity, given by the formula [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]:
p =
i=1
N
X P lsnt(ci) + |Attnt(ci)| − |Snst(ci)| + Aptit(ci)
3N
where N is the size of the SBoC. As an example of how the
Sentic API can be exploited for microblogging analysis,
intermediate and final outputs obtained when a natural language opinion is
given as input to the system can be examined. The tweet “I think
iPhone4 is the top of the heap! OK, the speaker is not the best i hv
ever seen bt touchscreen really puts me on cloud 9... camera looks
pretty good too!” is selected. After the pre-processing and
semantic parsing operations, the following SBoCs are obtained:
SBoC#1:
&lt;Concept: ‘think’&gt;
&lt;Concept: ‘iphone4’&gt;
&lt;Concept: ‘top heap’&gt;
SBoC#2:
&lt;Concept: ‘ok’&gt;
&lt;Concept: ‘speaker’&gt;
&lt;Concept: !‘good’++&gt;
&lt;Concept: ‘see’&gt;
SBoC#3:
&lt;Concept: ‘touchscreen’&gt;
&lt;Concept: ‘put cloud nine’++&gt;
SBoC#4:
&lt;Concept: ‘camera’&gt;
&lt;Concept: ‘look good’−−&gt;
        </p>
        <p>After feeding the extracted concepts to the Sentic API, we can
exploit semantics and sentics to detect opinion targets and obtain,
for each of these, the relative affective information both in a
discrete way (with one or more emotional labels) and in a dimensional
way (with a polarity value ∈ [-1,+1]) as shown in Table 1.
5.</p>
      </sec>
      <sec id="sec-3-13">
        <title>EVALUATION</title>
        <p>
          As a use case evaluation of the proposed API, we select the
problem of crowd validation of the UK national health service (NHS)
[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], that is, the exploitation of the wisdom of patients to adequately
validate the official hospital ratings made available by UK
healthcare providers and NHS Choices2. To validate such data, we exploit
patient stories extracted from PatientOpinion3, a social enterprise
providing an online feedback service for users of the UK NHS.
The problem is that this social information is often stored in natural
language text and, hence, intrinsically unstructured, which makes
comparison with the structured information supplied by health-care
providers very difficult. To bridge the gap between such data (which
are different at structure-level yet similar at concept-level), we
exploit the Sentic API to marshal PatientOpinion’s social
information in a machine-accessible and machine-processable format and,
hence, compare it with the official hospital ratings provided by
NHS Choices and each NHS trust.
        </p>
        <p>In particular, we use Sentic API’s inferred ratings to validate the
information declared by the relevant health-care providers, crawled
separately from each NHS trust website, and the official NHS ranks,
extracted using the NHS Choices API4. This kind of data usually
consists of ratings that associate a polarity value to specific features
of health-care providers such as ‘communication’, ‘food’,
‘parking’, ‘service’, ‘staff’, and ‘timeliness’. The polarity can be either
a number in a fixed range or simply a flag (positive/negative).</p>
        <p>Since each patient opinion can regard more than one topic and
the polarity values associated with each topic are often independent
from each other, we need to extract, from each opinion, a set of
topics and then, from each topic detected, the polarity associated
with it. Thus, after deconstructing each opinion into a set of SBoCs,
we analyze these through Sentic API in order to tag each SBoC with
one of the relevant topics (if any) and calculate a polarity value.
We ran this process on a set of 857 topic- and polarity-tagged short
stories extracted from PatientOpinion database and computed recall
and precision rates as evaluation metrics.</p>
        <p>As for the SBoC categorization, results showed that the Sentic
API can detect topics in patient stories with satisfactory accuracy.
In particular, the classification of stories about ‘food’ and
‘communication’ was performed with a precision of 80.2% and 73.4% and
recall rates of 69.8% and 61.4%, for a total F-measure of 74.6%
and 66.8%, respectively.
2http://nhs.uk
3http://patientopinion.org.uk
4http://data.gov.uk/data
As for the polarity detection, in turn, positivity and negativity
of patient opinions were identified with particularly high precision
(91.4% and 86.9%, respectively) and good recall rates (81.2% and
74.3%), for a total F-measure of 85.9% and 80.1%, respectively.
More detailed comparative statistics are listed in Table 2, where the
Sentic API is compared against WNA and SenticNet with respect to
the polarity detection F-measures obtained on the 857 short stories.</p>
      </sec>
      <sec id="sec-3-14">
        <title>CONCLUSION</title>
        <p>Today user-generated contents are perfectly suitable for human
consumption, but they remain hardly accessible to machines.
Currently available information retrieval tools still have to face a lot of
limitations. To bridge the conceptual and affective gap between
word-level natural language data and the concept-level opinions
and sentiments conveyed by them, we developed Sentic API, a
common-sense based application programming interface that
provides semantics and sentics associated with 15,000 natural
language concepts.</p>
        <p>We showed how Sentic API can easily be embedded in
realworld NLP applications, specifically in the field of microblogging
analysis, where statistical methods usually fail as syntax-based text
processing works well only on formal-English documents and
after training on big text corpora. We are keeping on developing the
resource in a way that it can be continuously enhanced with more
concepts from the always-growing Open Mind corpus and other
publicly available common and common-sense knowledge bases.
We are also developing novel techniques and tools to allow the
Sentic API to be more easily merged with external domain-dependent
knowledge bases, in order to improve the extraction of semantics
and sentics from many different types of media and contexts.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C.</given-names>
            <surname>Bazzanella</surname>
          </string-name>
          .
          <article-title>Emotions, language and context</article-title>
          . In E. Weigand, editor, Emotion in dialogic interaction.
          <source>Advances in the complex</source>
          , pages
          <fpage>59</fpage>
          -
          <lpage>76</lpage>
          . Benjamins, Amsterdam,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>C.</given-names>
            <surname>Bosco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Patti</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Bolioli</surname>
          </string-name>
          .
          <article-title>Developing corpora for sentiment analysis and opinion mining: A survey and the Senti-TUT case study</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>2</issue>
          ):
          <fpage>55</fpage>
          -
          <lpage>63</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bradley</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Lang</surname>
          </string-name>
          .
          <article-title>Affective norms for english words (ANEW): Stimuli, instruction manual and affective ratings</article-title>
          .
          <source>Technical report</source>
          , The Center for Research in Psychophysiology, University of Florida.,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cambria</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Hussain</surname>
          </string-name>
          . Sentic Computing: Techniques, Tools, and Applications. Springer, Dordrecht, Netherlands,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cambria</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hussain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Eckl</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Munro</surname>
          </string-name>
          .
          <article-title>Towards crowd validation of the UK national health service</article-title>
          . In WebSci, Raleigh,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cambria</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Livingstone</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Hussain</surname>
          </string-name>
          .
          <article-title>The hourglass of emotions</article-title>
          . In A.
          <string-name>
            <surname>Esposito</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Vinciarelli</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Hoffmann</surname>
          </string-name>
          , and V. Muller, editors,
          <source>Cognitive Behavioral Systems</source>
          , volume
          <volume>7403</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>144</fpage>
          -
          <lpage>157</lpage>
          . Springer, Berlin Heidelberg,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cambria</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Speer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <surname>A. Hussain.</surname>
          </string-name>
          <article-title>SenticNet: A publicly available semantic resource for opinion mining</article-title>
          .
          <source>In AAAI CSK</source>
          , pages
          <fpage>14</fpage>
          -
          <lpage>18</lpage>
          , Arlington,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Eckart</surname>
          </string-name>
          and
          <string-name>
            <surname>G. Young.</surname>
          </string-name>
          <article-title>The approximation of one matrix by another of lower rank</article-title>
          .
          <source>Psychometrika</source>
          ,
          <volume>1</volume>
          (
          <issue>3</issue>
          ):
          <fpage>211</fpage>
          -
          <lpage>218</lpage>
          ,
          <year>1936</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>A.</given-names>
            <surname>Esuli</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Sebastiani</surname>
          </string-name>
          .
          <article-title>SentiWordNet: A publicly available lexical resource for opinion mining</article-title>
          .
          <source>In LREC</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>L.</given-names>
            <surname>García-Moya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Anaya-Sanchez</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>R.</given-names>
            <surname>Berlanga-Llavori</surname>
          </string-name>
          .
          <article-title>A language model approach for retrieving product features and opinions from customer reviews</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>3</issue>
          ):
          <fpage>19</fpage>
          -
          <lpage>27</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Grassi</surname>
          </string-name>
          .
          <article-title>Developing HEO human emotions ontology</article-title>
          . volume
          <volume>5707</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>244</fpage>
          -
          <lpage>251</lpage>
          . Springer, Berlin Heidelberg,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Speer</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Holmgren</surname>
          </string-name>
          .
          <article-title>Automated color selection using semantic knowledge</article-title>
          .
          <source>In AAAI CSK, Arlington</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>R.</given-names>
            <surname>Horn</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Johnson</surname>
          </string-name>
          .
          <article-title>Norms for vectors and matrices</article-title>
          .
          <source>In Matrix Analysis, chapter 5</source>
          . Cambridge University Press,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C.</given-names>
            <surname>Hung and H.-K. Lin</surname>
          </string-name>
          .
          <article-title>Using objective words in SentiWordNet to improve sentiment classification for word of mouth</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>2</issue>
          ):
          <fpage>47</fpage>
          -
          <lpage>54</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>C.</given-names>
            <surname>Lanczos</surname>
          </string-name>
          .
          <article-title>An iteration method for the solution of the eigenvalue problem of linear differential and integral operators</article-title>
          .
          <source>Journal of Research of The National Bureau of Standards</source>
          ,
          <volume>45</volume>
          (
          <issue>4</issue>
          ):
          <fpage>255</fpage>
          -
          <lpage>282</lpage>
          ,
          <year>1950</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>M.</given-names>
            <surname>Minsky</surname>
          </string-name>
          .
          <source>The Emotion Machine: Commonsense Thinking, Artificial Intelligence, and the Future of the Human Mind . Simon &amp; Schuster</source>
          , New York,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>H.</given-names>
            <surname>Park</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Jun</surname>
          </string-name>
          .
          <article-title>A simple and fast algorithm for k-medoids clustering</article-title>
          .
          <source>Expert Systems with Applications</source>
          ,
          <volume>36</volume>
          (
          <issue>2</issue>
          ):
          <fpage>3336</fpage>
          -
          <lpage>3341</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>R.</given-names>
            <surname>Plutchik</surname>
          </string-name>
          .
          <article-title>The nature of emotions</article-title>
          .
          <source>American Scientist</source>
          ,
          <volume>89</volume>
          (
          <issue>4</issue>
          ):
          <fpage>344</fpage>
          -
          <lpage>350</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>S.</given-names>
            <surname>Poria</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gelbukh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hussain</surname>
          </string-name>
          ,
          <string-name>
            <surname>D. Das</surname>
            , and
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Bandyopadhyay</surname>
          </string-name>
          .
          <article-title>Enhanced SenticNet with affective labels for concept-based opinion mining</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>2</issue>
          ):
          <fpage>31</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>R.</given-names>
            <surname>Speer</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          .
          <article-title>ConceptNet 5: A large semantic network for relational knowledge</article-title>
          . In E. Hovy,
          <string-name>
            <given-names>M.</given-names>
            <surname>Johnson</surname>
          </string-name>
          , and G. Hirst, editors,
          <source>Theory and Applications of Natural Language Processing, chapter 6</source>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>C.</given-names>
            <surname>Strapparava</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Valitutti. WordNet-Affect</surname>
          </string-name>
          :
          <article-title>An affective extension of WordNet</article-title>
          . In LREC, pages
          <fpage>1083</fpage>
          -
          <lpage>1086</lpage>
          , Lisbon,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>A.</given-names>
            <surname>Tsai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Tsai</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Hsu</surname>
          </string-name>
          .
          <article-title>Building a concept-level sentiment dictionary based on commonsense knowledge</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>2</issue>
          ):
          <fpage>22</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>M.</given-names>
            <surname>Wall</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rechtsteiner</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Rocha</surname>
          </string-name>
          .
          <article-title>Singular value decomposition and principal component analysis</article-title>
          . In D. Berrar,
          <string-name>
            <given-names>W.</given-names>
            <surname>Dubitzky</surname>
          </string-name>
          , and M. Granzow, editors,
          <source>A Practical Approach to Microarray Data Analysis</source>
          , pages
          <fpage>91</fpage>
          -
          <lpage>109</lpage>
          . Springer,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>A.</given-names>
            <surname>Weichselbraun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gindl</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Scharl</surname>
          </string-name>
          .
          <article-title>Extracting and grounding context-aware sentiment lexicons</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>28</volume>
          (
          <issue>2</issue>
          ):
          <fpage>39</fpage>
          -
          <lpage>46</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>