<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
    <teiHeader>
        <fileDesc>
            <titleStmt>
                <title>Improving multilingual lexicon-based sentiment analysis for Scandinavian languages</title>
                <author>
                    <persName>
                        <surname>Baglini</surname>
                        <forename>Rebekah</forename>
                    </persName>
                    <affiliation>Department of Linguistics, Cognitive Science, and Semiotics, Aarhus University; Interacting Minds Centre, Aarhus University</affiliation>
                    <email>rbkh@cc.au.dk</email>
                </author>
                <author>
                    <persName>
                        <surname>Kurm</surname>
                        <forename>Anita</forename>
                    </persName>
                    <affiliation>Center for Humanities Computing, Aarhus University</affiliation>
                    <email>201608652@post.au.dk</email>
                </author>
                <author>
                    <persName>
                        <surname>Hansen</surname>
                        <forename>Lasse</forename>
                    </persName>
                    <affiliation>Center for Humanities Computing, Aarhus University</affiliation>
                    <email>lasseh0310@gmail.com</email>
                </author>
                <author>
                    <persName>
                        <surname>Enevoldsen</surname>
                        <forename>Kenneth</forename>
                    </persName>
                    <affiliation>Center for Humanities Computing, Aarhus University</affiliation>
                    <email>kenneth.enevoldsen@cas.au.dk</email>
                </author>
            </titleStmt>
            <editionStmt>
                <edition>
                    <date>2021-09-23T15:17:00Z</date>
                </edition>
            </editionStmt>
            <publicationStmt>
                <publisher>Elisabeth Burr, University of Leipzig</publisher>
                <address>
                    <addrLine>Beethovenstr. 15</addrLine>
                    <addrLine>04107 Leipzig</addrLine>
                    <addrLine>Germany</addrLine>
                    <addrLine>Elisabeth Burr</addrLine>
                </address>
            </publicationStmt>
            <sourceDesc>
                <p>Converted from a Word document</p>
            </sourceDesc>
        </fileDesc>
        <encodingDesc>
            <appInfo>
                <application ident="DHCONVALIDATOR" version="1.22">
                    <label>DHConvalidator</label>
                </application>
            </appInfo>
        </encodingDesc>
        <profileDesc>
            <textClass>
                <keywords scheme="ConfTool" n="category">
                    <term>Paper</term>
                </keywords>
                <keywords scheme="ConfTool" n="subcategory">
                    <term>Short Paper</term>
                </keywords>
                <keywords scheme="ConfTool" n="keywords">
                    <term>sentiment analysis</term>
                    <term>crosslinguistic</term>
                    <term>parallel corpus</term>
                    <term>normalization</term>
                </keywords>
                <keywords scheme="ConfTool" n="topics">
                    <term>Designing</term>
                    <term>Programming</term>
                    <term>Cleanup</term>
                    <term>Content Analysis</term>
                    <term>Modeling</term>
                    <term>Sharing</term>
                    <term>Meta: GiveOverview</term>
                    <term>Text</term>
                    <term>Language</term>
                    <term>Methods</term>
                    <term>ResearchProcess</term>
                    <term>not applicable</term>
                    <term>not applicable</term>
                    <term>English</term>
                </keywords>
            </textClass>
        </profileDesc>
    </teiHeader>
    <text>
        <body>
            <div type="div1" rend="DH-Heading1">
                <head>Introduction</head>
                <p>In this paper, we address the challenge of multilingual sentiment analysis using
                    traditional lexicon and rule-based tools, since these tools are inherently
                    tailored to capture sentiment patterns in a particular language. Focusing on a
                    case study of three closely related Scandinavian languages (Danish, Norwegian,
                    and Swedish) using three tailored versions of VADER, we measured the relative
                    degree of variation in valence using the OpenSubtitles corpus. We found that
                    scores for Swedish systematically skewed lower their translational pairs in
                    Danish, and that scores for Norwegian skewed higher than for both other
                    languages. We then trained a neural network to optimize the fit of Swedish <hi
                        rend="italic">&gt;</hi> Danish and Norwegian <hi rend="italic">&gt;</hi>
                    Danish, effectively correcting this skew. </p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>Background</head>
                <p>Lexicon-based tools are widely used in automated sentiment analysis and
                    opinion-mining tasks, and remain the most accessible and easy to validate method
                    of performing sentiment analysis on a text corpus. One of the most popular tools
                    of this kind is Valence Aware Dictionary and sEntiment Reasoner (VADER) (Hutto /
                    Gilbert 2014).</p>
                <p>Prior to this study, cross-linguistic comparative sentiment analysis using VADER
                    required the use of the multilingual version of VADER (<ref
                        target="https://pypi.org/project/vader-multi/"
                        >https://pypi.org/project/vader-multi/</ref>), which uses integration with
                    Google Translate API to automatically translate the source language into English
                    to produce sentiment scores. However, translation-based approaches are
                    inadequate for high-fidelity multilingual sentiment analysis given the high
                    degree of variation in the valency in the translational equivalents of
                    evaluative, subjective, and expressive words and expressions (Jackson et al.
                    2019; Mohammed et al. 2016).</p>
                <p>To avoid the problem of translation, we use an alternative approach to cross-linguistic VADER sentiment analysis which applies a normalization algorithm, trained on a parallel corpus, to adjust language-specific VADER model scores for Danish, Norwegian, and Swedish texts making them more comparable.</p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>VADER Sentiment Analysis tools in Danish, Swedish, and Norwegian</head>
                <p>The sentiment dictionaries used in this study build upon VADER (Hutto / Gilbert
                    2014), a dictionary- and rules-based approach to sentiment analysis on social
                    media. The new Danish VADER builds upon previous rule-based approaches to Danish
                    sentiment analysis namely SENTIDA (Lauridsen et al. 2019), EMMA (Kran / Orm
                    2020), and AFINN (Nielsen 2011) and extends upon them by adding support emoji
                    and replacing the use of stems with lemmas. The Swedish utilized the publicly
                    available VADER implementation of Swedish (Hutto 2017) while the Norwegian
                    (Bokmål) used a translation of the Danish corpus translated and validated by two
                    native speakers. As the dictionaries used are fairly small<note place="foot"
                        xml:id="ftn1" n="1">
                        <p rend="footnote description"> The Danish, Norwegian and Swedish contain
                            5264, 3214, and 5501 rated words, respectively.</p>
                    </note> all models utilize lemmatization using Stanza (Peng et al. 2020) as
                    opposed to the full word as the English<note place="foot" xml:id="ftn2" n="2">
                        <p rend="footnote description"> For reference the English VADER contain 50%
                            more rated words than the Danish and Swedish models.</p>
                    </note> VADER to obtain much wider coverage. These versions are freely available
                    online on <ref
                        target="https://github.com/centre-for-humanities-computing/text_to_x"
                        >https://github.com/centre-for-humanities-computing/text
                        to x.</ref>
                </p>
                <p>Note that comparatively better performance have been found for sentiment analysis
                    using attention-based model such as BERT (Devlin et al. 2019), but these treat
                    sentiment as a classification problem (for instance, GLUE reduces the sst-2 to a
                    classification task (Wang et al. 2019)).<note place="foot" xml:id="ftn3" n="3">
                        <p rend="footnote description"> For a full comparison of Danish NLP methods
                            which nicely reflect these trends please see</p>
                        <p rend="footnote description"
                            >https://github.com/alexandrainst/danlp/blob/master/docs/docs/tasks/sentiment_analysis.md. </p>
                    </note>
                </p>
                <table rend="rules">
                    <row role="label">
                        <cell rend="DH-Default">Language pair</cell>
                        <cell rend="DH-Default">Dataset size</cell>
                        <cell rend="DH-Default">Mean Danish</cell>
                        <cell rend="DH-Default">Mean Swedish</cell>
                        <cell rend="DH-Default">Mean Norwegian</cell>
                    </row>
                    <row>
                        <cell rend="DH-Default">Danish - Swedish</cell>
                        <cell rend="DH-Default">1,902,685</cell>
                        <cell rend="DH-Default">0.023</cell>
                        <cell rend="DH-Default">0.013</cell>
                        <cell rend="DH-Default">-</cell>
                    </row>
                    <row>
                        <cell rend="DH-Default">Danish - Norwegian</cell>
                        <cell rend="DH-Default">1,920,409</cell>
                        <cell rend="DH-Default">0.023</cell>
                        <cell rend="DH-Default">-</cell>
                        <cell rend="DH-Default">0.046</cell>
                    </row>
                    <row>
                        <cell rend="DH-Default">Swedish - Norwegian</cell>
                        <cell rend="DH-Default">1,909,422</cell>
                        <cell rend="DH-Default">-</cell>
                        <cell rend="DH-Default">0.012</cell>
                        <cell rend="DH-Default">0.047</cell>
                    </row>
                </table>
                <p>Table 1: Total number of OpenSubtitles parallel
                    sentences and mean VADER compound score</p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>Parallel translation corpus for sentiment tool validation</head>
                <p>The next step was to conduct pairwise comparisons of Danish, Swedish and Norwegian VADER sentiment tools using a corpus of translated movie subtitles (OpenSubtitles v.2018). From this corpus we sampled 1.9 million parallel sentence pairs for each language pair. We then applied our sentiment tools and calculated the average score (see Table 1).</p>
                <figure>
                    <graphic n="1001" width="16.1925cm" height="5.3975cm" url="Pictures/665ac15bff8f5db42ca935abe3be1e76.jpg" rend="inline"/>
                </figure>
                <p>Figure 1: Original VADER scores in Norwegian (blue), Swedish (yellow) and Danish (red) against each other. (Data: whole dataset reported in Table 1.)</p>
                <p>From Table 1, we can see that in comparison to Danish VADER, our Norwegian VADER tool has a tendency to assign higher sentiment scores, while the Swedish VADER tool – lower scores. From Figure 1 (centre), we can also see that Norwegian and Swedish VADER tools are similarly aligned in relation to the Danish version. We therefore selected Danish VADER as the baseline, and developed Swedish-to-Danish and Norwegian-to-Danish models to improve alignment of the other two SA tools.</p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>Model development and optimization</head>
                <p>We first tried to identify data input features for optimal prediction of target Danish compound score. By testing various linear models and shallow artificial neural networks (Sequential model with 2-3 dense layers composed of 16, 32, 64 nodes) with different input features, we selected the following best features:</p>
                <list type="unordered">
                    <item>VADER scores (neg, neu, pos, compound)</item>
                    <item>one-hot encoded compound score range
                        <list type="unordered">
                            <item>extremely neg [-1...-0.4]</item>
                            <item>mild neg [-0.4...-0.2]</item>
                            <item>neu [-0.2...0.2],</item>
                            <item>mild pos [0.2...0.4]</item>
                            <item>extremely pos [0.4...1]</item>
                        </list>
                    </item>
                </list>
                <p>We applied Autokeras 1.0.2 [6] for automated neural network architecture selection with these features, and then optimized the hyperparameters using the sweep functionality from Weights and Biases [1] on a validation set consisting of 20% of the data. This was done using Bayesian grid search over the following parameters: number of units in each layer l1-5 (16-254), batch size (250-1000), dropout, and learning rate (0.0005-0.002). The resulting optimal parameters were: l1 111 units, l2 174 units, l3 225 units, l4 247 units, l5 36 units, batch size 623, dropout 0.06, learning rate 0.0005.</p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>Effects of normalisation</head>
                <p>A random sample (n=50,000) from the testing part of the dataset was selected for every language pair for evaluation of normalisation effects. As shown in the results in Table 2, normalisation produces almost identical mean sentiment values in parallel sentences, but has significantly decreased variation of sentiment scores in the normalised data.</p>
                <table rend="rules">
                    <row role="label">
                        <cell style="text-align: left;">Language pair</cell>
                        <cell style="text-align: left;">Danish</cell>
                        <cell style="text-align: left;">Swedish</cell>
                        <cell style="text-align: left;">Norwegian</cell>
                    </row>
                    <row>
                        <cell style="text-align: left;">Danish - Swedish</cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.025, 
                            <hi rend="italic">σ </hi>= 0.264
                        </cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.025, 
                            <hi rend="italic">σ </hi>= 0.104 (
                            <hi rend="italic">µ </hi>= 0.014, 
                            <hi rend="italic">σ </hi>= 0.272)
                        </cell>
                        <cell style="text-align: left;">-</cell>
                    </row>
                    <row>
                        <cell style="text-align: left;">Danish - Norwegian</cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.022, 
                            <hi rend="italic">σ </hi>= 0.258
                        </cell>
                        <cell style="text-align: left;">-</cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.022, 
                            <hi rend="italic">σ </hi>= 0.094 (
                            <hi rend="italic">µ </hi>= 0.049, 
                            <hi rend="italic">σ </hi>= 0.083)
                        </cell>
                    </row>
                    <row>
                        <cell style="text-align: left;">Swedish - Norwegian</cell>
                        <cell style="text-align: left;">-</cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.022, 
                            <hi rend="italic">σ </hi>= 0.104
                        </cell>
                        <cell style="text-align: left;">
                            <hi rend="italic">µ </hi>= 0.024, 
                            <hi rend="italic">σ </hi>= 0.094
                        </cell>
                    </row>
                    <row>
                        <cell style="text-align: left;"/>
                        <cell style="text-align: left;"/>
                        <cell style="text-align: left;">(
                            <hi rend="italic">µ </hi>= 0.011, 
                            <hi rend="italic">σ </hi>= 0.273)
                        </cell>
                        <cell style="text-align: left;">(
                            <hi rend="italic">µ </hi>= 0.048, 
                            <hi rend="italic">σ </hi>= 0.284)
                        </cell>
                    </row>
                </table>
                <p>Table 2: Adjusted mean VADER compound scores and standard deviation after normalisation. Non-normed scores in parentheses. (Data: the 50K sample from the OpenSubtitles test set for each language pair)</p>
                <p>Furthermore, Table 3 shows that normalisation of Swedish and Norwegian sentiment scores has led to an increase in correlation (measured with non-parametric Spearman correlation test) and decrease in RMSE across all three language pairs.</p>
                <figure>
                    <graphic n="1002" width="15.769166666666667cm" height="5.229930555555556cm" url="Pictures/b16367e28ed0a729d45b197025ab74a7.jpg" rend="inline"/>
                 </figure>   
                    <p>Table 3: Spearman correlation r<hi rend="italic subscript">s</hi> and RMSE
                    before and after normalisation using the developed models. All reported
                    correlation tests yielded p-value <hi rend="italic">&lt;</hi> 0.001. (Data: the
                    50K sample from the OpenSubtitles test set for each language pair). </p>
            </div>
            <div type="div1" rend="DH-Heading1">
                <head>Conclusion and future work</head>
                <p>By applying a combination approach of language-specific sentiment scoring plus crosslingual score normalization, we hope to achieve a more satisfactory method for comparative lexicon-based sentiment analysis for these Scandinavian languages, without the use of automated translation.</p>
                <p>Because this is work in progress, neither the baseline nor normalized scores produced by the three VADER models have yet been validated against a sentiment evaluation corpus. Existing resources (tagged sentiment corpora) for all three languages will be used in an upcoming benchmarking task, comparing our normalized scores with the compound scores of the three original VADER models and VADER multilingual.</p>
            </div>
        </body>
        <back>
            <div type="bibliogr">
                <listBibl>
                    <head>Bibliography</head>
                    <bibl>
                        <hi rend="bold">Biewald, Lukas</hi> (2020): <hi rend="italic">Experiment
                            Tracking with Weights and Biases</hi> &lt;<ref
                            target="https://www.wandb.com/">https://www.wandb.com/</ref>&gt;
                        [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Devlin, Jacob</hi> / <hi rend="bold">Ming-Wei, Chang</hi> /
                            <hi rend="bold">Kenton, Lee</hi> / <hi rend="bold">Toutanova,
                            Kristina</hi> (2019): “BERT: Pre-training of Deep Bidirectional
                        Transformers for Language Understanding”, in: <hi rend="italic">Proceedings
                            of the 2019 Conference of the North American Chapter of the Association
                            for Computational Linguistics: Human Language Technologies</hi> 1 (Long
                        and Short Papers) 4171– 4186. Minneapolis, Minnesota: Association for
                        Computational Linguistics &lt;<ref
                            target="https://www.aclweb.org/anthology/N19-1423"
                            >https://www.aclweb.org/anthology/N19-1423</ref>&gt; [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Hutto, C. J. / Gilbert, Eric </hi>(2014): “VADER: A
                        Parsimonious Rule-Based Model for Sentiment Analysis of Social Media Text”,
                        in: <hi rend="italic">Proceedings of the International AAAI Conference on
                            Web and Social Media </hi>8, 1 &lt;<ref
                            target="https://ojs.aaai.org/index.php/ICWSM/article/view/14550"
                            >https://ojs.aaai.org/index.php/ICWSM/article/view/14550</ref>&gt;. </bibl>
                    <bibl>
                        <hi rend="bold">Hutto, C. J.</hi> (2017): vaderSentiment-swedish: VADER
                        Sentiment Analysis. VADER (Valence Aware Dictionary and Sentiment Reasoner)
                        swedish &lt;<ref
                            target="https://github.com/AlexGustafsson/vaderSentiment-swedish"
                            >https://github.com/AlexGustafsson/vaderSentiment-swedish</ref>&gt;
                        [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Jackson, Joshua Conrad</hi> / <hi rend="bold">Watts,
                            Joseph</hi> / <hi rend="bold">Henry, Teague R</hi> / <hi rend="bold"
                            >List, Johann-Mattis</hi> / <hi rend="bold">Forkel, Robert</hi> / <hi
                            rend="bold">Mucha, Peter J.</hi> / <hi rend="bold">Greenhill, Simon
                            J.</hi> / <hi rend="bold">Gray, Russell D</hi> / <hi rend="bold"
                            >Lindquist, Kristen A</hi> (2019): “Emotion semantics show both cultural
                        variation and universal structure”, in: American Association for the
                        Advancement of Science (ed.): <hi rend="italic">Science </hi>366: 1517–1522. </bibl>
                    <bibl>
                        <hi rend="bold">Jin, Haifeng</hi> / <hi rend="bold">Song, Qingquan</hi> /
                            <hi rend="bold">Hu, Xia </hi>(2019): “Auto-Keras: An Efficient Neural
                        Architecture Search System”, in: <hi rend="italic">Proceedings of the 25th
                            ACM SIGKDD International Conference on Knowledge Discovery &amp; Data
                            Mining</hi> 1946–1956. ACM. </bibl>
                    <bibl>
                        <hi rend="bold">Kran, Esben</hi> / <hi rend="bold">Orm, Søren</hi> (2020):
                        “EMMA: Danish Natural-Language Processing of Emotion in Text”, in: <hi
                            rend="italic">Journal of Language Works - Sprogvidenskabeligt
                            Studentertidsskrift </hi>5: 1: 92–110 &lt;<ref
                            target="https://tidsskrift.dk/lwo/article/view/121221"
                            >https://tidsskrift.dk/lwo/article/view121221/</ref>&gt; [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Lauridsen, Gustav Aarup</hi> / <hi rend="bold">Dalsgaard,
                            Jacob Aarup</hi> / <hi rend="bold">Svendsen, Lars Kjartan Bacherva</hi>
                        (2019): “SENTIDA: A New Tool for Sentiment Analysis in Danish", in: <hi
                            rend="italic">Journal of Language Works - Sprogvidenskabeligt
                            Studentertidsskrift </hi>4: 38–53 &lt;<ref
                            target="https://tidsskrift.dk/lwo/article/view/115711"
                            >https://tidsskrift.dk/lwo/article/view/115711</ref>&gt; [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Mohammad, Saif M.</hi> / <hi rend="bold">Salameh,
                            Mohammad</hi> / <hi rend="bold">Kiritchenko, Svetlana</hi> (2016): “How
                        translation alters sentiment”, in: <hi rend="italic">Journal of Artificial
                            Intelligence Research </hi>55: 95–130. </bibl>
                    <bibl>
                        <hi rend="bold">Nielsen, Finn Arup</hi> (2011): “A new ANEW: Evaluation of a
                        word list for sentiment analysis in microblogs”, in: <hi rend="italic"
                            >arXiv</hi> 1103.2903. </bibl>
                    <bibl>
                        <hi rend="bold">Qi, Peng</hi> / <hi rend="bold">Zhang, Yuhao</hi> / <hi
                            rend="bold">Zhang, Yuhui</hi> / <hi rend="bold">Bolton, Jason</hi> / <hi
                            rend="bold">Manning, Christopher D.</hi> (2020): “Stanza: A Python
                        Natural Language Processing Toolkit for Many Human Languages”, in: <hi
                            rend="italic">arXiv 2003.07082 [cs]</hi> &lt;<ref
                            target="http://arxiv.org/abs/2003">http://arxiv.org/abs/2003</ref>&gt;
                        [22.09.2021]. </bibl>
                    <bibl>
                        <hi rend="bold">Wang, Alex</hi> / <hi rend="bold">Singh, Amanpreet</hi> /
                            <hi rend="bold">Michael, Julian</hi> / <hi rend="bold">Hill, Felix</hi>
                        / <hi rend="bold">Levy, Omer</hi> / <hi rend="bold">Bowman, Samuel R. </hi>
                        (2019): “GLUE: A Multi-Task Benchmark and Analysis Platform for Natural
                        Language Understanding”, in: <hi rend="italic">arXiv 1804.07461 [cs]</hi>
                            &lt;<ref target="http://arxiv.org/abs/1804.07461"
                            >http://arxiv.org/abs/1804.07461</ref>&gt; [22.09.2021]. </bibl>
                </listBibl>
            </div>
        </back>
    </text>
</TEI>
