SENTIDA: A New Tool for Sentiment Analysis in Danish
Paper · 2019 · Gustav Aarup Lauridsen, Jacob Aarup Dalsgaard and Lars Kjartan Bacher Svendsen
Summary
A long collection of Danish reviews can tell a business how customers feel, but reading every review takes time. An automatic score can help make that collection tractable. The difficulty is deciding how much approval or disapproval the wording conveys. A word such as behageligt, meaning comfortable, typically gives a favorable signal. Put ikke, meaning not, in front of it and that signal can point the other way. SENTIDA addresses this problem in sentiment analysis by combining a Danish dictionary of sentiment ratings with rules for a few common ways that surrounding words and punctuation change an evaluation.
The authors independently rated common Danish words and then assessed additional candidates they found in AFINN, the existing Danish sentiment lexicon they use for comparison. SENTIDA reduces related word forms to a shared lookup key, so it can recognize forms beyond the ones originally rated. After lookup, ikke reverses ratings within a brief window, selected adverbs strengthen or soften the following word’s contribution, and an exclamation mark increases the magnitude of the sentence score. SENTIDA returns an average over the words that supplied a rating. The result indicates both a direction and a degree of sentiment.
The authors tested the scores against customer ratings and against judgments made by people asked to read for sentiment. On the held-out Trustpilot reviews in the positive-versus-negative experiment, average classification accuracy was 0.81 with SENTIDA and 0.745 with AFINN. In a different test using selected Trustpilot star levels, the rank correlation with stars was 0.63 for SENTIDA and 0.56 for AFINN. The authors also had readers score passages from politics, fiction, and social media. Across those passages, the correlation with averaged human judgments was 0.78 for SENTIDA and 0.55 for AFINN, with SENTIDA also ahead within each genre.
Those comparisons evaluate SENTIDA as a whole. The paper gives enough detail to see how a particular negation or intensifier changes a score, while the experiments leave the individual effects of the new vocabulary, word matching, and scoring rules unresolved. The human-rated passage collection is also small within each genre. The evidence for using SENTIDA is strongest when the aim resembles the paper’s tests, such as separating clearly labeled reviews or recovering the relative sentiment of short passages in a collection.
Deep dive: SENTIDA: A New Tool for Sentiment Analysis in Danish
SENTIDA measures sentiment in written Danish using word ratings and local rules, and compares its scores with review stars and human judgments. · about 38 minutes to read
The problem and its context
What an automatic score has to capture
The paper begins with a change in where people seek advice and where they leave it. Someone deciding how to spend a trip can consult discussions, recommendations, and reviews written by strangers. A company can gather many accounts of how its customers experienced a service. A researcher can examine what people have published about a public issue. Each example supplies a reason to study opinions collectively. The volume that makes such collections attractive also makes them difficult to read in their entirety. The authors cite research on depression and on movements in financial markets as examples of the wider interest in extracting signals from written sentiment.
In this branch of natural language processing, the question is how to turn a property of wording into a value that can be compared across texts. The paper focuses on polarity strength. Polarity is the direction of an evaluation, favorable or unfavorable. Strength is how far that evaluation moves away from neutrality. Two complaints can have the same polarity while differing in force. If the goal is to distinguish a mild disappointment from a strong complaint, a system that gives every negative word the same value gives up information the authors want to retain.
A score along this scale compresses several things that readers might describe separately. A text could contain little evaluative language, or it could give forceful praise and forceful criticism within the same passage. The combined value can be close to neutral in either case. This follows from the kind of measurement the paper sets out to make. The authors take an overall score as a way to compare texts or study patterns across a collection. Understanding why two pieces of writing arrived near the same value can still require looking at the words or reading the full passage.
The language itself poses a further problem. If a word tends to express approval, the tendency is good evidence in many settings. It can also be qualified, denied, or used with an intention that a reader gathers from elsewhere in the text. SENTIDA is organized around the parts of this problem that the authors thought they could address with a word list and a small set of operations. They want the scoring to benefit from familiar judgments about individual words and to make some use of how those words occur in a sentence.
The appeal and cost of counting words
A sentiment lexicon is a list of words with ratings attached. The basic procedure is to look for each word in the text and combine the corresponding ratings. Keeping the total gives a measure of accumulated positive and negative value. Averaging gives a measure of the typical contribution according to the chosen denominator. Either procedure can be carried out with the same lexicon, so the word list and the operation for turning a text into a score are distinct decisions.
The paper calls the basic approach bag of words. The name describes the information available to the calculation. The words can be counted and looked up, but their positions and grammatical connections are discarded. Moving a word around can leave every count unchanged while altering which part of a sentence it qualifies. A bag-of-words calculation also has no general way to determine how far the meaning of a negative marker extends. The authors see that weakness as particularly important because a single word can determine whether a favorable expression contributes evidence of enjoyment or dissatisfaction.
Assigning values to words nonetheless gives the calculation a useful starting point. An evaluative adjective or verb may supply evidence even when much of the text is ordinary description. It is also possible to examine how a rating entered the output. If a value seems surprising, a reader can look at the matched word, the number stored for it, and any operation that changed it. The authors preserve those properties and introduce order information selectively. They use location to decide which words to modify and punctuation to decide whether to intensify the combined value.
This design requires choices about vocabulary as well as grammar. An entry for a dictionary form is useful only if the system can connect it to forms people actually write. Listing several spellings of an inflected word solves that problem for those spellings. Grouping them under a common key has a different consequence. It makes the rating available to more forms, while allowing less discretion about the value assigned to each one. The authors’ assessment of the existing Danish lexicon led directly to this part of their design.
What the Danish benchmark offered
The paper frames Danish sentiment analysis as a problem of available resources. The authors contrast the development of tools for English with the smaller set they describe for Danish. The shortage they identify extends to evaluation material. A lexicon can be available for use while researchers still lack a collection of Danish texts with suitable sentiment judgments for comparing methods. In the paper’s discussion of low-resource languages, the lack of such collections makes it difficult to tell how reliably a tool works and where it fails.
The main Danish resource the authors identify is AFINN, compiled by Finn Årup Nielsen. Its entries were rated on a discrete scale from -5 to +5, with the sign distinguishing the two directions of sentiment. The intended use was chiefly microblogging. The authors also cite work that used the Danish resource to study political bias in newspapers. That application illustrates the practical reason for evaluating language from several settings. A lexicon prepared with one sort of writing in mind may be asked to score quite different material.
The paper counts 3552 entries in the Danish AFINN list it examines and gives 3089 as the vocabulary count when inflected variants are accounted for. The authors illustrate the issue with forms of fattig, meaning poor. Some entries that appear separately in a count of the list are different ways of writing an item from the same word family. Repeated coverage of that family can be useful during lookup. The authors’ concern is that the nominal list size gives a limited picture of how much distinct vocabulary the tool can recognize.
They also checked how plausible the assigned values looked. In a random sample of 200 AFINN words, they identified three that they considered substantially misrated. For instance, udsigtsløs, meaning hopeless or futile, had the favorable value +2. If a text uses the word in that unfavorable sense, the entry supplies evidence in the opposite direction from what a reader would gather. This inspection concerns particular word values. It provides examples of how problems can arise before the system has combined any words into a text score.
AFINN’s ratings came from a single annotator. The authors therefore had no measure of how closely independent raters would have agreed with those values. They also describe the Danish resource as lacking validation of the kind needed for their comparison. These concerns motivate two choices in SENTIDA. Its authors can compare their word judgments with one another before combining them, and they can put both tools through the same evaluations. An imperfect rating becomes an issue that can be examined at the level of a word, while a tool’s usefulness can be examined at the level of the texts it was made to score.
Finding a reference for the sentiment of a text
A paper that tests a sentiment score has to say what counts as an appropriate answer. Customer reviews often arrive with a judgment supplied by the reviewer. The prose is available as the input to a tool, and the stars provide a reference that was supplied independently of its score. Those stars can be used to divide examples into favorable and unfavorable groups or to provide ordered categories. The choice determines whether the experiment tests a binary decision or the tendency for stronger scores to accompany higher ratings.
There is also a reason to ask readers to rate texts directly. Fiction, a political passage, and a social media post may have no equivalent of a review’s stars. Even where stars exist, they reflect the reviewer’s overall choice and can differ from what another person would infer from the words alone. Direct human ratings let the investigators define a common task for the readers. It then becomes possible to compare the contributions found by SENTIDA with judgments formed by considering each passage as a whole. The paper assembles both kinds of evidence because its intended use extends beyond the setting that supplies the most conveniently labeled texts.
The method, step by step
The vocabulary the authors started with
SENTIDA requires work before any new text can be scored. The authors needed a pool of words to consider, judgments about how favorable or unfavorable those words generally are, and a way to recognize them in running text. They also needed to specify which surroundings warrant a change in an ordinary lexical value. Most of this work consists of choosing resources and setting rules. The statistical fitting described later in the paper is part of one evaluation, after the tools have already calculated their text scores.
For the initial vocabulary, the authors used a resource from Det Danske Sprog- og Litteraturselskab, abbreviated DSL. It lists the 10.000 most frequent Danish lemmas in the resource. A lemma is the form traditionally used to represent a word in a dictionary or a word list. Encountering a verb in a particular tense and looking it up under its dictionary form illustrates the distinction between what is printed in a sentence and what the resource uses to represent it.
The frequency resource comes from BAKSPEJLET, a corpus assembled in 2016 using material from several domains dated from 1983 until 2016. A corpus is a collection of texts brought together for study. Here it supports the decision about which vocabulary to rate first. The authors reason that frequent words from a mixed corpus make a suitable starting point for a tool intended to handle general written Danish. The resulting sentiment values are human judgments about the candidate words. The fact that a word was frequent supplied a reason to consider it, and the annotators decided what rating it should have.
The authors restricted that list using the word categories available in the resource. They kept adjectives, adverbs, common nouns, verbs, and interjections. These categories can carry an evaluation in different ways. An adjective can describe an experience as unpleasant, for instance, while an interjection can express a reaction. The authors expected these categories to yield sentiment-bearing entries and reduced the list to 9.779 lemmas for the initial round of evaluation. Membership in one of the selected categories still left every word’s direction and strength to be judged separately.
How the ratings became a lexicon
The authors carried out the linguistic annotation independently. Annotation here means applying a common set of instructions to give each lemma a value. The 11-point coding scheme used 0 for neutral, -5 for very strong negative sentiment, and 5 for very strong positive sentiment. The middle of the scale is important because many common words can appear in an evaluative passage without conveying a favorable or unfavorable judgment on their own. The scheme gave the annotators a way to record that assessment.
Having the authors rate independently let them examine agreement before forming a shared value. They report Krippendorff’s alpha of 0.667 for the lemma judgments, calculated with the package irr in RStudio. Alpha measures agreement among annotators with allowance for agreement that could occur by chance. The authors consider the result sufficient for tentative conclusions. It leaves room for differences in how they understood particular words or in the strength they assigned to a broadly shared interpretation.
A mean rating was calculated for each lemma. Pooling the judgments makes the lexicon usable as a single resource even where the authors chose different points. A mean on this scale can lie between selectable rating points. For instance, a decimal value in the scoring procedure is consistent with a lexicon that combines judgments originally expressed on a discrete scale. The authors dropped lemmas whose accumulated rating was 0. A lemma could have a combined contribution of 0 through neutral judgments or through judgments that canceled when combined. Either way, the decision uses the combined value to determine whether an entry is included.
The authors then compared the assembled list with AFINN and found 1379 lemmas that AFINN supplied and their initial lexicon lacked. They inspected and re-annotated these candidates with the same scheme. This gives AFINN two roles in the paper. It is a source of vocabulary worth considering and the benchmark against which the finished system is evaluated. A candidate’s earlier inclusion in AFINN explains where the authors found it. Its rating for SENTIDA comes from the new annotation procedure.
The two sources address different practical concerns. The frequency list gives broad coverage of vocabulary encountered in written Danish. Checking AFINN gives the authors a way to recover candidates already identified as relevant to sentiment, including items that the initial selection or rating process had left out. Where a word enters the candidate pool and how strongly the finished tool regards it are separate matters. Neither the initial selection nor the subsequent rating uses the result of predicting a Trustpilot star category to decide the value for a word.
Using stems as lookup keys
If the lexicon uses a lemma as its key, finding the right entry can be a problem when the text contains an inflected form. SENTIDA uses stemming for this step. A stem in this procedure is the shortened form produced by a rule for reducing a word. The authors use the Snowball stemmer through the R package SnowballC. They apply it to the items in the lexicon during construction and to words in incoming text during scoring. Lookup succeeds when the reduction yields a key that the prepared list contains.
The paper illustrates the idea with spille, the verb to play, which yields spil. Forms such as spillende, meaning playing, and spillerne, meaning the players, can share that lookup key. An entry attached to the key can then be recovered from more than one written form. The forms in the authors’ example also show why a stem is best understood as the outcome of the reduction procedure. The relationships among the resulting matches include a verb, forms used to refer to players, and a form referring to the game. The lookup can proceed on their shared key without first resolving those grammatical differences.
Once the lemmas had been reduced, the authors grouped the entries whose stems coincided. They took the mean of the ratings in each group as the value for the common key. There are therefore multiple occasions for averaging in the construction. Combining the annotators’ judgments provides a rating for a lemma. Combining ratings after stemming provides a value for a key where several lemmas lead to it. At scoring time the tool retrieves that shared value. The spelling of the original word no longer selects a separate number among the values that went into the mean.
The authors report 5263 entries in the compressed lexicon and estimate that it can detect ~35.000 Danish words. The first figure counts keys in the prepared list. The second expresses the wider reach the authors attribute to matching different written forms to those keys. A shorter list can therefore serve a broader range of input spellings. How frequently that broader reach supplies a rating in practice depends on the words that appear in a particular collection.
The grouping can also join words with different meanings. The authors give adskille, meaning to separate, and adskillige, meaning several, as examples of forms that lead to the same stem. This is consequential even before sentiment is calculated. The lookup key has lost the distinction between those written words. A shared rating may consequently be a better account of some of the words that reach it than of others. That tradeoff applies both to accidental collisions and to genuinely related forms whose sentiment strengths differ.
From a string of words to a score
For a new input, SENTIDA divides the text into words, a form of tokenization. Each word is reduced with the same stemmer used to build the lexicon. Finding a key provides a rating for that word. The procedure then has an ordered series of positions with ratings where lookup succeeded. SENTIDA consults that order when applying the rules for ikke and selected adverbs, and uses punctuation at the level of the combined score.
A word can matter to these operations even when it supplies no lexical rating. For example, the negation rule specifies a window of word positions. A word with no dictionary match can occupy a place inside that window. Conversely, a recognized adverb can change the value used for its neighbor because it is present in a separate modifier list. A text’s contribution to the score thus depends both on the values retrieved and on signals that tell the program what to do with those values.
How a Danish text becomes a SENTIDA score
The steps in order.
The distinctions among the rules matter. Negation changes direction. A listed adverb changes intensity at a single following position. An exclamation mark intensifies the combined sentence score. The authors use examples from the review material to show the effect of each operation. The expressions below describe those operations in terms of the score entering the rule and the contribution that leaves it.
Reversing the direction after ikke
When SENTIDA encounters ikke, meaning not, it reverses the ratings of the next two words. In a plain bag-of-words score, a favorable adjective would contribute the same positive value whether the text affirms or denies that quality. SENTIDA uses the position of ikke to decide when a favorable value should contribute negatively. The same sign reversal applies when the affected starting value is negative.
s′ = −1 × s
Here s is the value to which the negation rule is applied. s′ is the adjusted value, with the prime mark indicating the result of the rule. The factor −1 reverses the sign, × denotes multiplication, and = equates the adjusted value with the product.
In the authors’ example, behageligt has the starting score +3. It appears after ikke and contributes -3. The magnitude of the word’s contribution stays the same. Its direction changes, giving the combined score evidence of discomfort where the unadjusted value would have indicated comfort. The rule can reach a word even when another word intervenes, so it can account for more than strict adjacency. Its reach is still determined by the number of word positions.
Why use that shortcut? The paper draws on an account of how Danish ikke is commonly used as a negator, particularly in the written material the tool targets. The authors also explain how the cue can serve a different function. A question containing ikke before a favorable description can invite a listener to agree with the description. The tool reverses the value if the favorable word falls inside the window. When ikke occurs after a statement as a prompt for a response, the position itself changes what the rule can affect. These cases expose the difference between following the direction of the text and inferring what a speaker is doing with the particle.
Changing the force of an evaluation with an adverb
With a recognized modifier, SENTIDA looks at the immediately following word and multiplies its rating by a value assigned to the modifier. Most values in the paper’s list increase the magnitude of the rating. The list also allows for softening. If an unfavorable word is intensified, its contribution grows more negative. If it is softened, the contribution moves toward neutrality. The same operation applies in the favorable direction.
s′ = m × s
Here s is the rating to which the adverb adjustment applies at the next word position. m is the multiplier associated with the adverb. s′ is the contribution after modification, as indicated by the prime mark. The operation × is multiplication, and = gives the result of that operation as the new contribution.
The values combine earlier work and the authors’ own judgments. The paper draws on Dragut and Fellbaum’s investigation of adverbs in sentiment analysis. Some expressions were translated and kept the earlier multipliers, on the assumption that the corresponding adverbs were used similarly. Other expressions were added and assigned values for SENTIDA. The resulting resource is a list of specific words with fixed factors. Recognizing an adverb in the general grammatical sense is a broader task than finding one in that list.
The reported value is 1.2 for meget, ekstremt, totalt, utroligt, and rimelig. The factor is 1.4 for mega and seriøst. The paper gives lidt a factor of 0.8 in its use as a downtoner. These values express how the procedure changes the target rating. They belong to the modifier list and apply equally to the direction of the contribution the tool happens to retrieve at the following position.
In the review example, meget, meaning very, sits before irriterende, meaning annoying. The paper gives irriterende a starting value of -2.667 and reports -3.2 after the factor of 1.2 is applied. The longer sentence concerns a late delivery and contains other words with ratings. The adjusted value is the contribution from irriterende in that sentence. To obtain the text score, the program still has to combine that contribution with the others.
The narrow reach of the rule reflects the same design choice as the negation window. Adjacency makes the intended operation easy to specify and to inspect in examples. If another word intervenes between a modifier and the evaluation a person takes it to modify, the strength change still goes to the next position. The method therefore depends on whether word order in a particular expression places the intended evaluation where the rule looks for it.
Amplifying the sentence with punctuation
The exclamation rule operates once the individual word contributions can be combined. The paper motivates the factor with a study in which an exclamation mark was associated with an average increase of 29.10% in perceived sentiment. SENTIDA uses 1.291 as the multiplier for a sentence with such punctuation. The words give the score its direction, and the punctuation increases its magnitude.
S′ = 1.291 × S
In this expression, S is the combined sentence score before the punctuation adjustment. S′ is the adjusted score, with the prime mark indicating the change. The number 1.291 is the paper’s factor for an exclamation mark, × denotes multiplication, and = identifies the adjusted value with the product.
The paper illustrates the operation with a review containing uprofessionelt, meaning unprofessional. The starting score in the example is -4 and the resulting score is -5.164. The mark strengthens the disapproval already supplied by the word. A favorable starting score would be intensified in the favorable direction. A combined score of 0 stays at 0 under the multiplication.
This example also helps explain the relation between the annotation scale and the scoring scale. The coding scheme constrains the ratings a person can give to a lemma. After lookup, a punctuation rule or a modifier can change a contribution beyond that range. Nothing in the described operation clips the example back to the end of the annotation scale. The final number is a result of the adjustments and averaging the authors specified, so numerical agreement with a reader’s choice on the original scale is a separate matter to investigate.
Returning the mean contribution
The program returns the combined score divided by the count of words that contributed. The authors use this normalization to lessen the influence of text length. A longer passage may carry more sentiment words merely because it contains more wording. Summing their contributions would allow that difference to increase the size of the total. The mean gives the score an interpretation as sentiment per contributing word.
M = T ÷ N
Here M is the mean score the procedure returns. T is the total after the specified word adjustments and the relevant punctuation adjustment. N is the number of words that contributed to the score. The symbol ÷ denotes division, and = gives the mean as the quotient.
The denominator determines what sorts of passages can end up with similar scores. A piece of writing with few recognized evaluative words can receive a strong value if those words carry strong ratings. Another passage may have many evaluative matches whose average is similar. The score summarizes the direction and strength of the evidence found in each passage. The calculation does not supply the match count as a second measure of how much evidence lay behind that value. Similarly, adding unrated material leaves the average unchanged when it alters neither a local rule nor the punctuation adjustment.
The authors made SENTIDA available for download and use in RStudio. Its method is defined by the annotated vocabulary, the stemmer, and the rules just described. A new text can receive its mean sentiment score through that procedure alone. In the classification experiment, the authors put a statistical decision on top of the mean. In the ranking experiments, they compare the mean directly with the ordering supplied by stars or readers.
Experiments and results
A shared set of reviews for different questions
The authors compare SENTIDA with AFINN throughout the empirical study. Each experiment gives both tools the same input texts and the same reference judgments. What changes from one experiment to another is the kind of conclusion drawn from a score. The binary review test asks whether scores support a correct decision about the polarity of a review. The ranking tests ask whether scores tend to increase with ratings, either those supplied by reviewers themselves or those assigned to short passages by annotators.
The review collection comprised 8800 items from Trustpilot’s Danish site, covering different categories. The mean length in the collection was 74.6 words, and the standard deviation was 78.9 words. The latter describes the spread of review lengths. This collection was the source for two subsets, each defined by the star levels suitable for its evaluation. Because the subsets come from the same pool, results on them apply different measures to related material.
Corpus I, used for binary text classification, contained 7019 reviews. The authors treated 1 and 2 stars as negative, and 4 and 5 stars as positive. The middle star category was omitted. The binary classes therefore have a precise meaning in this experiment. A prediction counts as correct when it recovers the group determined by the customer’s stars, regardless of whether a fresh reader would place the prose in the same group.
Corpus II, the basis of the review ranking experiment, contained 5307 reviews at 1, 3, and 5 stars. This selection retains the middle category and removes the levels next to the extremes. The authors follow the rationale of the VADER evaluation by Hutto and Gilbert, which considered reviews at those neighboring levels difficult to distinguish from the extreme categories. A ranking result on Corpus II describes how sentiment scores order the selected groups. Distinguishing all the intervals on the original star scale would require additional evidence.
Fitting a binary decision from each score
For Corpus I, the authors fitted a logistic regression for each tool. This procedure estimates the probability that a review belongs to the positive group given its mean sentiment score. The score is the predictor, the quantity used to make the prediction. The review class derived from the stars is the outcome. When the estimated relationship is positive, a higher sentiment score yields a higher estimated probability of a positive review.
Allowing the regressions to be fitted separately has a practical purpose. The tools can use different numerical ranges in practice, and a given value need not have the same implication for the chance of a positive review in both. The regression learns that relationship for each score. The resulting classification tests the usefulness of the score after this conversion to a probability. The construction of the lexicon and adjustment of individual word contributions take place before this stage.
The training portion was 80% of Corpus I, containing 5615 reviews. The remaining 20%, containing 1404 reviews, was held out for evaluation. The fitted relationship was applied to those held-out scores. The authors assigned the positive class when the estimated probability exceeded 50% and the negative class when it fell below 50%. This cutoff is on the fitted probability, which makes the experiment different from simply using the sign of the mean sentiment score as the class decision.
For SENTIDA, the paper reports χ²(1) = 2422.8 with p < .001 for the association between its scores and the binary review outcome. The estimated regression coefficient was 2.49, with standard error 0.07 and a z statistic of 35.57, also at p < .001. A regression coefficient here describes the change in log odds for a unit increase in the predictor. The standard error describes uncertainty in the estimate, and the z statistic compares the estimate with that uncertainty. The associated odds ratio, 12.09, expresses the fitted change as a multiplier of the odds of a positive review. Odds compare the probability of the positive outcome with that of the negative outcome.
For AFINN, the analogous chi-squared statistic was 1877.1 with p < .001. The coefficient was 0.99, its standard error was 0.03, and its z statistic was 35.59, with p < .001. The odds ratio was 2.69. The positive estimates give substantial evidence that both scores were related to reviewer polarity under the fitted procedure. The authors cite the larger chi-squared statistic for SENTIDA as evidence of a better fit. The estimated coefficients and odds ratios describe a unit change on each tool’s own score scale. The common held-out accuracy measure provides a more direct comparison of how often the predictions agreed with the observed class.
Accuracy on reviews held out of fitting
The authors report results across 10 classification trials. The average held-out accuracy was 0.81 for SENTIDA, with a standard deviation of 0.01. For AFINN it was 0.745, with a standard deviation of 0.02. Accuracy is the share of held-out reviews assigned to the correct class. The two standard deviations here describe variation in the reported accuracies across trials. They measure a different quantity from the standard deviation of review lengths or the uncertainty in a fitted coefficient.
Mean held-out classification accuracy on Trustpilot Corpus I
SENTIDA produced the higher average accuracy across the trials.
The numbers
| System or setting | accuracy |
|---|---|
| AFINN | 0.745 |
| SENTIDA (this paper) | 0.81 |
SENTIDA’s trial values run from 0.80 to 0.83 in the paper’s results table, and AFINN’s from 0.70 to 0.77. The individual trials give a sense of the size and consistency of the performance seen on this task. The SENTIDA table includes trials at 0.80, which matters when reading the paper’s broad description of performance above 80%. The measured advantage belongs to prediction on Corpus I with the authors’ categories, fitting procedure, and held-out reviews.
This experiment gives a score-based classifier an opportunity to use more information than whether the text score is positive or negative. It can learn how the distribution of values relates to the class labels before applying its probability cutoff. The result is therefore useful for judging the score as input to such a classifier. An application that interprets sentiment from the raw score alone asks a related question with a different decision rule.
Rank correlation with customer stars
For Corpus II the authors used Spearman rank-order correlation. In a rank correlation, the order induced by each measurement is what matters. A favorable score can agree with the stars by tending to move upward as the star ratings increase, even if the numerical distance between its low and high values is very different from the distance between star levels. The procedure measures that overall tendency in the presence of reviews that do fall out of order.
For SENTIDA, the correlation between review scores and the stars on Corpus II was 0.63. For AFINN it was 0.56. Both correlations had reported p-values below .001, and the paper interprets both as strong positive associations. A p-value here concerns the evidence for an association under the test. The size of the correlation expresses how closely the ordering follows the reference. The higher coefficient for SENTIDA is the basis for the authors’ comparison on this task.
Spearman rank correlation with review stars on Trustpilot Corpus II
SENTIDA scores follow the ordering by stars more closely.
The numbers
| System or setting | Spearman correlation |
|---|---|
| AFINN | 0.56 |
| SENTIDA (this paper) | 0.63 |
The correlation uses scores from the two tools directly. It has neither the fitted binary conversion nor a probability cutoff at which a particular review is called positive. This makes it a separate check on the score. A score can be useful for sorting reviews even where assigning a class would require choosing a boundary. Conversely, a tool could separate groups well under a threshold while supplying a relatively loose ordering elsewhere. The review results examine each of these properties under its own selection of stars.
The authors also discuss an earlier evaluation of tools on English-language Amazon reviews. Their account gives .571 for the Hu–Liu sentiment lexicon and .565 for VADER, which were the highest coefficients in that comparison. SENTIDA’s Trustpilot coefficient is higher than those reported values. The comparison supplies context for the size of the observed association on customer reviews. The language, collection, and evaluation setting differ, so the coefficients have different reference material. The comparison on Trustpilot itself is between SENTIDA and AFINN.
Ratings by readers of short passages
The authors wanted an evaluation in which the reference judgments would go beyond the experience that prompts a customer to assign stars. They assembled 45 sentiment-bearing passages from political writing, fiction, and social media, with 15 in each domain. They describe the passages as randomly chosen. Mean text length was 37.3 words with a standard deviation of 15.9. The test concerns short pieces selected for containing sentiment, and the passages span several purposes for which someone might write in Danish.
Six annotators, including the authors, assigned ratings individually. The scale ran from -5 to 5, as in the lexical coding scheme. Applying the scale to an entire passage is a different task from applying it to a lemma. A reader of a passage can judge the force of a word given the other words, infer what a qualification refers to, or consider the writer’s overall emphasis. The procedure lets those judgments contribute to the reference without requiring the readers to identify the individual phrases that led to the number.
The reference value for each passage was the mean of its human ratings. The paper reports Krippendorff’s alpha of 0.901 for passage annotation. This measures agreement in that reading task. It gives grounds for treating the average as a stable reference for these passages, even though the annotators could differ about particular items. The alpha pertains to the human readers. It is distinct from the correlation of each tool’s text scores with the reference formed from their judgments.
The comparison again uses Spearman correlation. Pooling the passages asks how well a tool orders them by sentiment when material from all the genres is considered together. The separate genre calculations ask whether the ordering also works within each set of passages. This is an important distinction when the aim is to score varied material. A pooled ordering can be influenced by how different groups are arranged relative to one another. A calculation within a genre can only draw on differences among the texts in that group.
Results within genres and across them
Across the 45 passages, the correlation with the averaged human ratings was 0.78 for SENTIDA and 0.55 for AFINN. Both pooled correlations were significant at p < .001. The values indicate a positive ordering relationship for both systems. The larger SENTIDA value shows closer agreement with the readers’ ordering, on a reference that was created specifically to measure sentiment in the passages.
The political set gave correlations of 0.72 for SENTIDA and 0.54 for AFINN. In fiction the values were 0.74 and 0.53. In social media the corresponding values were 0.86 and 0.55. The SENTIDA coefficients for politics and fiction were reported at p < .01, and the social media coefficient at p < .001. AFINN’s correlations in the individual genres were each reported at p < .05. The p-values refer to associations with the reference ratings in the respective sets.
Spearman rank correlation with human ratings on the short passage collections
SENTIDA scored higher than AFINN in each genre and in the pooled comparison.
The numbers
| System or setting | Spearman correlation |
|---|---|
| AFINN, politics | 0.54 |
| SENTIDA, politics (this paper) | 0.72 |
| AFINN, fiction | 0.53 |
| SENTIDA, fiction | 0.74 |
| AFINN, social media | 0.55 |
| SENTIDA, social media | 0.86 |
| AFINN, pooled passages | 0.55 |
| SENTIDA, pooled passages | 0.78 |
Social media produced SENTIDA’s highest correlation in the genre tests. The paper reports a gap between the tools of 0.31 in social media, alongside 0.18 in politics and 0.21 in fiction. Those are differences between observed correlations on each set of passages. The genre results show that the advantage over AFINN in the pooled data also appears within each collection sampled for the study. The result therefore bears on the authors’ aim to handle several sorts of writing, with the strength of that evidence bounded by the size and selection of the individual sets.
What the ablations show
The system comparison and its reach
The paper contains no component ablation, a test that removes or replaces a feature while holding the rest of the procedure fixed, and instead analyzes the complete tools, the distribution of stem ratings, and specific examples of the scoring rules.
The most controlled comparison is between the outputs of SENTIDA and AFINN on shared texts. In the binary experiment the authors fit the same kind of predictor from each tool’s score, with the same outcome definition. In the ranking experiments the ordering from each tool is compared to the same human reference. That shared setup gives the observed difference a straightforward meaning. The combination of lexicon and scoring procedure in SENTIDA yields a more informative score for the tasks as specified.
Assigning credit inside that combination would require an additional comparison. For instance, when SENTIDA retrieves a value that AFINN misses, it could be because the new list contains a relevant word, because an inflection reaches a shared stem, or because both are needed for the match. When the tools both recognize a word, the revised rating can affect the difference, as can any of the local rules. The paper changes these parts together. The reported outcomes show their combined performance and leave their separate contributions open.
The genre comparison is another analysis of complete scores. The largest observed advantage in the genre tests occurs in the social media set. A reader might ask whether the short-range rules happen to fit the writing in that set especially well. The paper gives no counts of rule use or matches by genre that could connect that explanation with the result. Relative performance within the sampled social media passages is measured. The source of the particular advantage remains unresolved.
The values available at lookup
The authors examine the distribution of the final stem ratings. The lexicon contains 2839 positive stems, representing 54% of the entries, and 2424 negative stems, representing 46%. About 53% of its stems have ratings between -1 and 1. At the more extreme ends, the paper reports 11% between -3 and -5 and 5% between 3 and 5. A slight numerical majority of stems points in the positive direction, while the reported tail of strongly negative ratings contains more entries than the strongly positive tail.
These counts describe the opportunities the lexicon gives the score to take on different values. An inventory with somewhat more favorable stems can still produce strongly negative values if the matched adverse terms are numerous or strong in the input. Negation can also change which direction an entry contributes after lookup. Drawing a conclusion about a corpus from the inventory alone would require knowing how frequently the stems occur and how the rules affect them. The paper gives the inventory distribution as a description of the resource rather than measuring a tendency in a particular collection through those counts.
The agreement statistics likewise describe features of the data the system depends on. The agreement on lemma ratings bears on the repeatability of annotation for words considered individually. The agreement on passage ratings bears on a reference made by reading full texts. Differences in annotator groups and in what they judged accompany the difference in reported agreement. The values give information about each judgment procedure, while leaving open how much of the difference comes from being able to read words in context.
The behavior the examples pin down
The worked examples trace a computation at the scale of a particular cue. The sign change on behageligt isolates the immediate effect of the negation decision. The change to irriterende shows how an awarding or withholding of intensity is applied to an individual contribution. The exclamation example shows an adjustment later in the procedure, after a combined sentence value is available. Together the examples explain why adding these features can change an output even when the available lexicon matches stay the same.
The examples are valuable for diagnosing what the tool will do in comparable cases. For instance, inspecting a sentiment error after ikke involves asking which positions came inside the window and what ratings they had. The same inspection could reveal an appropriate reversal or an unwanted one. The paper establishes the possibility of both outcomes by explaining the rule and discussing a use of the cue that can mislead it. It does not count the frequency of either outcome in the evaluation material. The experiments establish the advantage of the finished score, and the worked cases show how features available within that score can affect individual pieces of text.
Limitations
Limits the authors identify
The authors identify context as the main difficulty. The rules act on particular words, short stretches of order, and a punctuation mark. A reader can also work out the grammatical relationship between expressions at a distance and use the surrounding passage to decide how to interpret a particular remark. The paper observes that the fuller meaning of words depends in part on syntax and on patterns of occurrence. The score has a much narrower view of those surroundings. Its local sensitivity is useful precisely where the available cue tracks what the writer is doing.
The authors discuss homographs, words with the same spelling and different meanings. Where two senses share a lookup form, a single entry gives the same value regardless of which sense appears. The issue is at the level of word interpretation, and other difficulties arise at the level of expressions. A proverb may communicate an evaluation through an image, and familiar sayings can express something a reader would struggle to recover by adding associations from their separate words. The lack of handling for these cases affects the use of idioms and multiword expressions.
Sarcasm and irony are also outside the interpretive capabilities the authors claim for SENTIDA. A form of praise used to convey criticism leaves a favorable cue in the text. Whether that cue is sincere can depend on a larger setting than either a neighboring word or an exclamation mark. In such a case a rule that amplifies the apparent evaluation can increase the size of an error. The paper’s description of conversational uses of ikke makes a related point. A local marker can perform several functions in language even when the procedure assigns it a single common function for scoring.
Another limit comes from treating related forms as equivalent for lookup. The authors use vred, meaning angry, and the forms vredere and vredeste to make the issue concrete. The comparative and superlative forms convey stronger degrees of anger. The shared stem rating in the example gives the forms equal strength. This is a different failure from confusing semantically unrelated words that end up at an identical stem. A genuinely related form can still convey a difference worth preserving in a tool concerned with intensity.
The paper also identifies limits in the test material. Trustpilot consumers assign stars without applying a shared coding scheme. The score is calculated from the review text, while the stars can reflect what mattered most to the person making the overall judgment. A mismatch can arise from the wording and the star rating expressing somewhat different evaluations of the experience. The authors consequently interpret stars as a practical reference whose relation to sentiment in the text varies by review.
For the directly annotated material, the authors regard 15 passages per genre as too few for comprehensive validation. They also point to the six readers per passage and to the inclusion of the authors in that group. Since the authors helped define and rate the lexicon, some preferences that shaped the scoring resource could also have shaped the text-level judgments used as a reference. That is a possible source of bias the authors identify. The study compares the scores with the judgments it collected, and the agreement statistic describes those judgments on the sampled passages.
In their discussion, the authors invoke earlier work, including OpinionFinder, when describing human annotation agreement of roughly ~80%. They argue that variation in human judgments makes sentiment difficult to quantify and caution against treating automated text scoring as a substitute for close discourse analysis. Large collections and individual texts invite different questions. The score can help estimate tendencies across a collection, while a close reading can account for who expresses a sentiment, toward what, and with what apparent intention.
Limits that follow from the evaluation design
Human annotation agreement and accuracy against customer labels measure different things. The general ceiling the authors suggest from earlier agreement results does not follow from the Trustpilot setup. The outcome there is a class constructed from stars, and any agreement statistic from a separate annotation task concerns a different group of people and a different decision. The paper’s own held-out table includes values above 0.80. The results describe what was possible against that particular reference, while the evidence about human variation explains why a general measure of sentiment is difficult to define.
Corpus I leaves middle-star reviews outside its class definition. A system used on unfiltered reviews would also encounter material that falls into that omitted group. Corpus II includes the middle level but leaves out the levels adjacent to the extremes. It consequently gives little direct evidence about resolving closely spaced star levels. Both choices make sense for the particular test the authors describe. The resulting accuracy and correlation describe performance conditional on those choices.
Overall accuracy also leaves the distribution of errors open. If the task is identifying complaints, the share of unfavorable reviews recovered would be especially relevant. If the task is finding favorable reviews, a different set of errors matters. The reported accuracy averages the correctness of those decisions on the held-out set. The paper does not give class-specific results from which to judge how a user interested in one of those outcomes might fare. The probability threshold is specified as above or below 50%, and the assignment for an exact tie is also unspecified.
Likewise, a rank correlation measures agreement in relative ordering. Two passages may receive sentiment scores that place them in the same order as the readers do while still being far from those readers’ numerical values. The change between the passages can also look small in one score and large in the other without breaking their order. The experiment gives evidence about relative strength. It leaves the accuracy of absolute scores, such as whether an automatic value corresponds to the intensity a reader would assign to a single passage, open.
Each reported significance test for a correlation concerns the association between a score and the human reference. The paper does not report a direct statistical test of the difference between the tools’ correlations on the same texts. The observed differences are clear in the reported coefficients. The precision of those differences, particularly in the genre subsets, is a separate question. The same applies to the ordering of the genres by observed performance. Social media gave the largest SENTIDA coefficient in this collection, with no test establishing the stability of that ordering across new samples.
The composition of the passage collection further limits the scope of the domain claim. The passages were short and selected as sentiment-bearing. Longer pieces can combine evaluations across sentences or involve changes in whom the text is discussing. A collection that includes much neutral prose can change how frequently the procedure finds any useful matches. The study shows performance on the categories and pieces it contains. Extrapolating to a genre’s full range of writing, or to substantially different kinds of Danish text, requires evidence about those inputs.
There are a few implementation questions left open by the method as described. The average is defined over contributing words, so a passage with no lexical contribution needs a convention for its return value. The description does not specify that convention. It also gives examples of isolated adjustments and leaves the treatment of repeated exclamation marks or overlapping negation windows unspecified. Those details could affect reproduction of an individual score even when the documented examples and overall scoring principle are clear.
Finally, the paper uses results on English-language material to place its own numbers in context. In the discussion the authors also cite the accuracy levels described by Socher and colleagues’ sentiment treebank study. Similar metrics make comparisons of reported values possible, while differences in texts and labeling procedures affect their meaning. A reliable claim of relative performance between SENTIDA and the English tools would require shared evaluation conditions. AFINN is the benchmark for which the authors provide that comparison.
What came after
The paper can be followed through the development it proposes, with no documented later study here that establishes how those proposals were used. The authors suggest broadening the vocabulary and involving more annotators. More words would address what SENTIDA can recognize. More raters would address whose judgments determine the values and how consistently those judgments can be made. These directions arise from distinct parts of the method, since a word can be readily recognized while its appropriate sentiment rating remains difficult to agree on.
The authors also consider adding functions inspired by machine learning. They discuss the ability of context-based approaches to represent different uses of a word, along with the demands those approaches can place on training data, processing, and memory. They are interested in combining selected capabilities with a lexical procedure that remains straightforward to use. The paper cites earlier work on combining learned and lexical methods as a reason to consider this direction. That work is part of the motivation available to the authors, and the gains measured in the SENTIDA experiments belong to the rules and lexicon evaluated in the paper.
The open question left by the paper is how to improve contextual interpretation while retaining the inspectable path from a word match to a text score. The proposed extensions could be judged against the paper’s distinct targets, including classification from review prose and agreement with readers on relative sentiment. The results reported for SENTIDA establish the starting point for such comparisons, with the extensions left for subsequent evaluation.
Cite
Cite as Gustav Aarup Lauridsen, Jacob Aarup Dalsgaard and Lars Kjartan Bacher Svendsen. 2019. SENTIDA: A New Tool for Sentiment Analysis in Danish. Journal of Language Works - Sprogvidenskabeligt Studentertidsskrift.
@article{lauridsen2019sentida,
title = {{SENTIDA: A New Tool for Sentiment Analysis in Danish}},
author = {Gustav Aarup Lauridsen, Jacob Aarup Dalsgaard and Lars Kjartan Bacher Svendsen},
journal = {Journal of Language Works - Sprogvidenskabeligt Studentertidsskrift},
year = {2019},
url = {https://tidsskrift.dk/lwo/article/view/115711}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/lauridsen-2019-sentida-new-tool-sentiment-analysis/