<!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>Sentiment Analysis at SEPLN (TASS)-2019: Sentiment Analysis at Tweet Level Using Deep Learning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Avishek Garain</string-name>
          <email>avishekgarain@gmail.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sainik Kumar Mahata</string-name>
          <email>sainik.mahata@gmail.com</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Avishek Garain Computer Science and Engineering Jadavpur University</institution>
          ,
          <addr-line>Kolkata</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Sainik Kumar Mahata Computer Science and Engineering Jadavpur University</institution>
          ,
          <addr-line>Kolkata</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>611</fpage>
      <lpage>617</lpage>
      <abstract>
        <p>This paper describes the system submitted to "Sentiment Analysis at SEPLN (TASS)-2019" shared task. The task includes sentiment analysis of Spanish tweets, where the tweets are in di erent dialects spoken in Spain, Peru, Costa Rica, Uruguay and Mexico. The tweets are short (up to 240 characters) and the language is informal, i.e., it contains misspellings, emojis, onomatopeias etc. Sentiment analysis includes classi cation of the tweets into 4 classes, viz., Positive, Negative, Neutral and None. For preparing the proposed system, we use Deep Learning networks like LSTMs.</p>
      </abstract>
      <kwd-group>
        <kwd>BiLSTM</kwd>
        <kwd>STM</kwd>
        <kwd>Regularizers</kwd>
        <kwd>Sentiment Analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CuDNNLSentiment Analysis (SA) refers to the use of Natural Language Processing
(NLP) to systematically identify, extract, quantify, and study a ective states and
subjective information. The Sentiment Analysis at SEPLN (TASS)-2019 3 was a
classi cation task where it was required to classify a Spanish tweet on basis of its
sentiment,into various classes like, Positive, Negative, Neutral and None. It was
further divided into two subtasks;the rst subtask being monolingual testing of
system while the second task being cross-lingual testing of system. However, the
task threw some additional challenges. The given tweets involved lack of context,
where the number of words were less than 240. Moreover, the tweets were in an
informal language and contained multi-linguality. Also, the classi cation system
that would be prepared for the task, needed to be generalized for various test
corpora as well.</p>
      <p>To solve the task in hand, we built a bidirectional Long Short Term Memory
(LSTM) based neural network, for prediction of the sentiments present in the
provided dataset. For both the subtasks, our system categorized the instances
into P, N, NEU and NONE.</p>
      <p>The rest of the paper has been organized as follows. Section 2 describes the
data, on which, the task was performed. The methodology followed is described
in Section 3. This is followed by the results and concluding remarks in Section
4 and 5 respectively.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Data</title>
      <p>
        The dataset that was used to train the model was provided by InterTASS[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
The data was collected from Twitter and it was retrieved using the Twitter API
by searching for keywords and constructions that are often included in various
texts of di erent sentiments. The dataset provided consisted of tweets in their
original form along with the corresponding P, N, NEU and NONE labels, as shown
in Table 1.
      </p>
      <p>The dataset originally comprised of Spanish tweets of various dialects, namely
ES(Spain), PE(Peru), CR(Costa Rica), UR(Uruguay) and MX(Mexico). The tweets
were also tagged with their respective sentiments. We merged all this data and
shu ed them. The resulting dataset had 7,265 sentiment tagged tweets, which
were splitted into 5,086 instances of training data and 2,179 instances of
development data. Our approach was to convert the tweets into a sequence of words
and convert them into word embeddings. We then run a neural-network based
algorithm on the processed tweet. Language and label based categorical division
of data is given in Table 2, 3, 4 and 5.</p>
      <p>The provided training and development data were merged and shu ed to
create a bigger training set, and we refer to the same as training data in the
methodology section.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Methodology</title>
      <p>
        The rst stage in our model was to preprocess the tweets. For the preprocessing
steps, we took inspiration from the work on Hate Speech against immigrants in
Twitter[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], part of SemEval2019. The steps used here are built as an
advancement of this work. It consisted of the following steps:
1. Removing mentions
2. Removing URLs
3. Contracting whitespace
4. Extracting words from hashtags
      </p>
      <p>The last step (step 5) consists of taking advantage of the Pascal Casing
of hashtags (e.g. #TheWallStreet). A simple regex can extract all words; we
ignore a few errors that arise in this procedure. This extraction results in better
performance mainly because words in hashtags, to some extent, may convey
sentiments of hate. They play an important role during the model-training stage.</p>
      <p>
        We treat each tweet as a sequence of words with interdependence among
various words contributing to its meaning. We convert the tweets into one-hot
vectors. We also include certain manually extracted features listed below:
1. Counts of words with positive sentiment, negative sentiment and neutral
sentiment in Spanish
2. Counts of words with positive sentiment, negative sentiment and neutral
sentiment in English
3. Subjectivity score of the tweet
4. Number of question marks,Exclamations and full-stops in the tweet
For this, we used SenticNet5[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for nding sentiment values of individual words
after converting the sentences to English via GoogleTrans API. Apart from this,
we also used a Spanish Sentiment lexicon for the same.
      </p>
      <p>
        The use of BiLSTM networks is a key factor in our model. The work of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
brought a revolutionary change by bringing the concept of memory into usage
for sequence based problems. We were guided by the work of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] who used a
CNN+GRU based approach for a similar task. We use an approach which was
in uenced by this work to some extent.
      </p>
      <p>We use a bidirectional LSTM based approach to capture information from
both the past and future context followed by an Attention layer consisting of
initializers and regularizers.</p>
      <p>Our model is a neural-network based model. Initially, the manual feature
vectors are appended with the feature vector obtained after converting the
processed tweet to one-hot encoding. It is then passed through an embedding layer
which transforms the tweet into a 128 length vector. The embedding layer learns
the word embeddings from the input tweets. We pass the embeddings through a
Batch Normalization layer of dimensions 10 X 128. This is followed by one
bidirectional LSTM layer containing 128 units with its dropout and regular dropout
set to 0.4 and activation being a sigmoid activation. This is followed by a
Bidirectional CuDNNLSTM layer with 64 units for better GPU usage. This is followed
by the nal output layer of neurons with softmax activation, where, each neuron
predicts a label as present in the dataset.</p>
      <p>For both subtasks 1 and 2, we train a model containing 4 neurons for
predicting P(0/1), N(0/1) and NEU(0/1) and NONE(0/1) respectively. After the
CuDNNLSTM layer we have added a regularizing layer which is initialized with
glorot uniform initializer. This layer has both W regularizers and b regularizers
to prevent the model from over tting. This provides better validation and test
results by generalizing the feature learning process. The model is compiled using
the Adam optimization algorithm with a learning rate of 0.0005.
Categoricalcrossentropy is used as the loss function. The working is depicted in Figure 1.</p>
      <p>We note that the dataset is highly skewed in nature. If trained on the entire
Data</p>
      <p>Concatenate</p>
      <p>Embedding Layer</p>
      <p>Batch Normalization
Bidirectional LSTM
Bidirectional CuDNN</p>
      <p>LSTM
Output</p>
      <p>Dense Layer</p>
      <p>Regularizer
training dataset without any validation, the model tends to completely over t
to the class with higher frequency as it leads to a higher accuracy score.</p>
      <p>To overcome this problem, we took some measures. Firstly, the training data
was split into two parts | one for training and one for validation comprising
70 % and 30 % of the dataset respectively. The training was stopped when two
consecutive epochs increased the measured loss function value for the validation
set.</p>
      <p>Secondly, class weights were assigned to the di erent classes present in the
data. The weights were approximately chosen to be proportional to the inverse
of the respective frequencies of the classes. Intuitively, the model now gives equal
weight to the skewed classes and this penalizes tendencies to over t to the data.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>We participated in subtasks 1 and 2 of Sentiment Analysis at SEPLN
(TASS)2019 and our system ranks rst among the competing participants.</p>
      <p>We have included the automatically generated tables with our results. The
results(rounded o to 3 decimal places) are depicted in Table 6, 7 and 8.</p>
      <p>One-Hot Encoding</p>
      <p>Blob Score,
Punctuation count,
No. of +ve words, No.
of -ve words, No. of
neutral words</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this system report, we have presented a model which performs satisfactorily in
the given tasks. The model is based on a simple architecture. There is scope for
improvement by including more manually extracted features (like those removed
in the preprocessing step) to increase the performance. Another fact is that
the model is a constrained system, which may lead to poor results based on
the modest size of the data. Related domain knowledge may be exploited to
obtain better results. Use of regularizers led to proper generalization of model,
henceforth increasing our task submission score.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. et Al.,
          <string-name>
            <surname>V.R.</surname>
          </string-name>
          : Tass - workshop
          <source>on sentiment analysis at sepln (2013-03)</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Cambria</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poria</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hazarika</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kwok</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Senticnet 5: Discovering conceptual primitives for sentiment analysis by means of context embeddings</article-title>
          .
          <source>In: AAAI</source>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>D</given-names>
            <surname>az-Galiano</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.C.</surname>
          </string-name>
          , et al.:
          <article-title>Overview of tass 2019</article-title>
          .
          <article-title>CEUR-WS, Bilbao</article-title>
          , Spain (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Garain</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Basu</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>The titans at SemEval-2019 task 5: Detection of hate speech against immigrants and women in twitter</article-title>
          .
          <source>In: Proceedings of the 13th International Workshop on Semantic Evaluation</source>
          . pp.
          <volume>494</volume>
          {
          <fpage>497</fpage>
          . Association for Computational Linguistics, Minneapolis, Minnesota, USA (Jun
          <year>2019</year>
          ), https://www.aclweb.org/anthology/S19-2088
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hochreiter</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidhuber</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>Long short-term memory</article-title>
          .
          <source>Neural Comput</source>
          .
          <volume>9</volume>
          (
          <issue>8</issue>
          ),
          <volume>1735</volume>
          {1780 (Nov
          <year>1997</year>
          ). https://doi.org/10.1162/neco.
          <year>1997</year>
          .
          <volume>9</volume>
          .8.1735, http://dx.doi.org/10.1162/neco.
          <year>1997</year>
          .
          <volume>9</volume>
          .8.
          <fpage>1735</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Robinson</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tepper</surname>
          </string-name>
          , J.:
          <article-title>Detecting Hate Speech on Twitter Using a Convolution-GRU Based Deep Neural Network</article-title>
          .
          <source>In: Lecture Notes in Computer Science</source>
          . Springer Verlag (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>