Automatically Building a Corpus for Sentiment Analysis on Indonesian Tweets
Paper · 2014 · Alfan Farizki Wicaksono, Clara Vania, Bayu Distiawan et al.
Summary
Indonesian Twitter offered plenty of posts for studying opinions, but the researchers had little labeled data for teaching a classifier to recognize them. A tweet can report a service interruption, complain about it, or praise the people who resolved it. For sentiment analysis, these are different outcomes. Wicaksono and colleagues ask whether they can build the necessary training corpus automatically, then use it to find opinion tweets and determine whether those opinions are positive or negative.
The authors start with a collection of 5.3 million tweets. They try two ways of labeling a starting set. One counts positive and negative words from an Indonesian opinion lexicon and accounts for negation. The other groups tweets using their words and grammatical tags. A Naive Bayes classifier learns from these starting labels, assigns positive and negative probabilities to tweets in a separate collection, and then learns again from the original labels and the new probabilities. The authors repeat this procedure, known as expectation–maximization, and retain additional tweets whose final scores strongly favor either positive or negative sentiment.
The authors compare both expanded corpora with a baseline corpus whose labels come from happy and sad emoticons. They match the amount of training data offered to competing classifiers and test against human judgments. With maximum entropy as the classifier, the corpus started from the lexicon yields an F1 score of 80.91% for finding opinion tweets, compared with 76.56% for the emoticon baseline. On the positive-versus-negative test, which uses tweets that human annotators judged to be opinions, the same comparison gives 86.82% accuracy versus 73.35%.
The choice of starting labels matters. The clustering approach also produces a large corpus, yet classifiers trained on it score below the emoticon baseline on both tasks. In a separate experiment using the lexicon-based corpus, the authors also see Naive Bayes accuracy fall at the largest training size they tried. They suggest that noise in the automatic labels could account for the drop. The experiments establish that the lexicon-based procedure yields useful training examples for the Indonesian tweets they studied. They also show why the number of examples a procedure can produce is a poor guide to how useful those examples will be.
Deep dive: Automatically Building a Corpus for Sentiment Analysis on Indonesian Tweets
Wicaksono and colleagues build a sentiment corpus for Indonesian tweets from automatic labels and test which labels make useful training data. · about 31 minutes to read
The problem and its context
Abundant text and scarce labels
A collection of tweets lets a researcher observe what people write, but it takes an additional step to turn those posts into examples a classifier can learn from. Wicaksono and colleagues are interested in whether a tweet expresses an opinion and, if it does, in the direction of the opinion. They give examples of why someone might want this information. A company could look for praise and complaints about its products, including the reasons people give. A consumer could use accounts of other people's experiences before making a purchase. Both uses require some way to distinguish expressions of approval or dissatisfaction from the other messages in a large stream.
The authors describe a particular resource problem for Indonesian. The language had a substantial presence on Twitter, and the paper points to the activity of users in Indonesia, particularly in Jakarta, as an indication that there was material worth studying. At the same time, the authors describe a shortage of basic resources for language technology, especially labeled datasets. In this sense, the designation low-resource language concerns the resources available for the task. A language can have an active population of speakers and a plentiful supply of online writing while researchers still have few collections in which someone has judged what each message expresses.
A supervised text classification system learns from examples in which a piece of text comes with its intended category. That requirement changes the value of an archive. A large pool of tweets supplies examples of how people actually write, including expressions missing from a small hand-prepared collection. For training to make use of those examples, the categories must come from somewhere. Manually labeling tweets at the scale the authors envisaged would take time and money, particularly for a stream that keeps producing new messages. Their aim was to use a small amount of initial information to assign labels across a much larger collection and then test whether those labels were good enough for training.
Why the paper asks two questions of a tweet
The authors follow an earlier division of sentence-level sentiment analysis into a subjectivity decision and a sentiment decision. For their purposes, an opinion conveys an evaluation, feeling, or attitude directed towards an entity or some aspect of it. Imagine a post announcing that a bus route has been suspended, a post criticizing the way the suspension was handled, and a post commending the replacement service. All three could concern the same transport system. The announcement belongs on the neutral side of the first decision. The other posts belong on the opinion side, where the next question is which direction the sentiment takes.
The paper calls the first task opinion tweet extraction. Extraction here takes place at the level of the whole tweet. The system is given posts and selects those it judges to be opinionated. It does not have to identify a span that contains the opinion or return the entity it is about. The second task, tweet polarity classification, puts an opinion tweet into a positive or negative category. The same words can help with both decisions. A word associated with praise can be evidence that an opinion is present and evidence that the likely polarity is positive. The reference labels and the consequences of mistakes differ between the tasks. A missed opinion is an extraction error. Calling an already identified opinion positive when the reference is negative is a polarity error.
This division also gives the corpus builders a reason to look for different sources of examples. For polarity, they need positive and negative tweets. For extraction, both of those groups count as opinionated and must be compared with examples treated as neutral. The procedure at the center of the paper expands the pool of positive and negative material. The neutral training examples come from a separate collection rule. Understanding that division makes sense of how the same expanded corpus can support both tests.
The alternatives the authors inherit
The paper situates its work in a field that had concentrated heavily on reviews before turning towards social media. Its discussion of earlier research identifies manually labeled data as a common basis for training, including in studies that directly addressed Twitter. Human annotation can judge a sentiment conveyed through wording even when a post lacks an overt mark such as a smiley. The expense of labeling messages at scale motivated attempts to use signals already present in the posts. Sentiment Analysis of Twitter Data and SemEval-2013 Task 2: Sentiment Analysis in Twitter
One alternative was to infer sentiment from emoticons. A smiling face would supply a positive training label, and a sad face would supply a negative one. The rule gives a researcher a way to collect labeled examples with little intervention once the markers are chosen. It also determines which expressions of sentiment the collector can reach. A complaint written without an emoticon stays outside the collection even if its wording clearly conveys dissatisfaction. Wicaksono and colleagues use this method as their baseline because it gives them an existing automatic procedure to compare with their proposal. They also adopt the earlier work's use of news accounts as a source of messages presumed to be neutral. Twitter as a Corpus for Sentiment Analysis and Opinion Mining
The paper describes earlier attempts specific to Indonesian tweets as limited. One study examined posts about telephone providers, drawing on a small collection of opinion words relevant to that domain. Another treated positive, negative, and neutral as classes of a single decision and used emoticons to collect examples. The present study seeks wider coverage by starting from automatically labeled tweets and allowing their vocabulary to guide the labeling of other messages. Its general precedent is earlier work combining labeled and unlabeled documents through expectation–maximization. The question here is whether the same approach can supply training data for short Indonesian social media posts. Text Classification from Labeled and Unlabeled Documents Using EM
The method, step by step
Give the source collections distinct jobs
The authors collected tweets through the Twitter Streaming API from May 16th, 2013 to June 26th, 2013. They used geographic information to focus on posts from Indonesia and applied a language filter. The latter was necessary because the researchers observed that users in Indonesia also wrote in English and local languages. Geographic origin and language were both relevant to the collection they wanted.
The resulting collection contains 5,304,314 tweets across disjoint sets. DATASET2 contains 1,000,000 initially unlabeled tweets and supplies the material from which the seed labels are made. DATASET1 contains 4,291,063 unlabeled tweets and supplies the candidates for expansion. DATASET3 contains 12,614 tweets from selected Indonesian news portal accounts and supplies the neutral training class. DATASET4 holds 637 tweets for testing. People assign the labels in this last collection, independently of the rules that assign the training labels.
The news account rule assumes that messages from the selected portals are typically headlines and can serve as objective examples. The authors say that their own observations supported this choice. The remaining collections come from the portion of the archive outside those selected accounts. An important distinction follows from the partition. A positive or negative seed label is evidence used to train the expansion classifier. A human judgment in the test set is evidence used to assess what the downstream classifiers learned. Keeping the underlying posts apart allows the authors to compare those two kinds of judgment.
Building and testing the Indonesian tweet corpus
The steps in order.
Obtain starting labels from words or clusters
The lexicon procedure uses a list of Indonesian words associated with positive or negative opinion. The basic decision compares the number of words associated with each polarity. A positive majority leads to a positive label, and a negative majority leads to a negative label. The authors describe reversing the polarity when an opinion word is preceded by a negation. This matters because the same recognizable word can support a different sentiment when it appears after a negator. Tweets with no match to the opinion lexicon are left out of the seed collection. The account specifies a majority rule and leaves the treatment of a tie unspecified.
The lexicon is a source of prior linguistic judgments. Its entries already carry a polarity association before the algorithm sees the seed tweets. The automatic procedure applies that knowledge to individual posts. A common sentiment word can supply the initial evidence even if there is no smiley, while wording outside the inventory may still enter the corpus at the later expansion stage. The seed procedure itself has a narrower job. It produces enough examples in each polarity to give the next stage a starting point.
The clustering procedure draws on the texts in a different way. It groups tweets using their terms and part-of-speech tags, which describe a word's grammatical role or category. The terms receive TF-IDF weights, so the representation can give more influence to terms that are informative for a tweet in relation to the wider collection. The authors present the procedure as a way to obtain seeds without supplying an opinion dictionary for the language. They group tweets under positive, negative, and neutral categories, retain 325 positive and 194 negative tweets, and leave the rest out of the seed corpus.
Grouping messages by their features offers a way to discover similarities. The positive and negative names given to the retained groups, however, must carry sentiment information into the next stage. Tweets can share vocabulary for reasons that include what they are discussing as well as how they feel about it. The paper reports the features and the resulting seed groups, while leaving the operational details of how the groups acquire their polarity labels less explicit than the lexicon's word-count decisions. For the rest of the procedure, both routes produce the same kind of input: a collection of tweets carrying either a positive or a negative starting label.
Use the initial labels to score new tweets
The authors' working assumption is that a labeled tweet can help predict the sentiment of an unlabeled one through words they share. Consider an unlabeled post that contains several words frequently found in the positive seeds. Once the classifier has learned how frequent those words are in the positive and negative seeds, the post may receive a higher positive score. Its words can then contribute to further training in proportion to that score. A different post that shares vocabulary with the newly scored one may acquire stronger evidence in a later pass. This is how sentiment propagation works in the paper. It passes through estimates of word frequencies by class.
The expansion classifier is Naive Bayes. It combines a class prior, which expresses how prevalent a polarity is estimated to be, with the probabilities of the words in the tweet under that polarity. The calculation is insensitive to a word's position and treats token occurrences as conditionally independent given the polarity. Different occurrences of the same word contribute repeatedly. For this part of the paper there are only positive and negative choices, so each tweet receives scores relative to those two classes.
The procedure starts by learning from the labeled seeds alone. It then alternates between computing scores for the unlabeled tweets and updating its estimates using both collections. The first operation is the expectation step, frequently called the E-step. It works out how much of the evidence from each unlabeled tweet to credit to each polarity under the current estimates. The second operation is the maximization step, or M-step. It re-estimates the class priors and word probabilities from the fixed seed labels and the fractional assignments of the unmarked tweets. This approach is useful when an observation is available but part of its description is missing. Here the researchers can read the text of every tweet in the expansion pool, while its polarity remains unknown.
These fractional assignments have a specific advantage over assigning a single winner immediately. A tweet with closely matched positive and negative scores contributes to both classes during re-estimation. A tweet with scores strongly favoring one class contributes mainly to that class. The distinction gives the process a way to represent uncertainty while it learns. Only after the iterations end do the authors make a separate decision about which of the newly scored tweets should become training examples.
Scores and parameter estimates
The paper calls the complete collection used in an expansion run T. It consists of the labeled seeds Tₗ, taken from DATASET2, and the unlabeled tweets Tᵤ, taken from DATASET1. The two sets are disjoint. In the expressions that follow, tᵢ is tweet i, |tᵢ| is its length in word tokens, and wₖ in the product over that tweet means the token at position k. V is the vocabulary and |V| gives its size. The same word notation is used in the estimation equations to refer to vocabulary entries, whose occurrences are counted across tweets.
P(Cⱼ ∣ tᵢ) = [P(Cⱼ) ∏ₖ₌₁^|tᵢ| P(wₖ ∣ Cⱼ)] / [∑ₕ∈S P(Cₕ) ∏ₖ₌₁^|tᵢ| P(wₖ ∣ Cₕ)]
P denotes probability, and the vertical bar inside its arguments means “given.” S is the set of polarity indices, pos for positive and neg for negative. Cⱼ is the class with index j, and h runs over both indices when normalizing the score in the denominator. P(Cⱼ) is the current prior probability of class Cⱼ. P(wₖ ∣ Cⱼ) is the probability of the word at position k under that class. The product multiplies those word probabilities across the tweet, starting at position 1. The sum in the denominator combines the prior-weighted products for both classes. The resulting P(Cⱼ ∣ tᵢ) is the share of that combined quantity assigned to Cⱼ for tweet tᵢ. The two shares add to 1.
The parameters, collectively called θ, comprise the class priors and all class-specific word probabilities. The authors describe estimating them by maximizing their posterior probability given the tweets, a procedure called maximum a posteriori estimation.
P(θ ∣ T) ∝ P(T ∣ θ) P(θ)
P(θ ∣ T) is the probability of the parameters θ after observing the tweet collection T. P(T ∣ θ) is the likelihood of the collection at those parameter values, and P(θ) is the prior over parameter values. The proportionality sign means that, for a fixed T, the right-hand side gives the posterior up to a factor that is constant with respect to θ. Maximizing the product therefore gives the same point estimate of θ as maximizing the posterior. The paper denotes that fitted estimate by θ̂.
P(wₖ ∣ Cⱼ) = [1 + ∑ᵢ₌₁^|T| N(wₖ, tᵢ) P(Cⱼ ∣ tᵢ)] / [|V| + ∑ₙ₌₁^|V| ∑ᵢ₌₁^|T| N(wₙ, tᵢ) P(Cⱼ ∣ tᵢ)]
Here wₖ is the vocabulary entry being estimated and P(wₖ ∣ Cⱼ) is its probability under class Cⱼ. The index i ranges over the |T| tweets used for the update, and n ranges over the |V| words in the vocabulary. N(wₖ, tᵢ) counts how often wₖ appears in tᵢ. Multiplying this count by the current class assignment P(Cⱼ ∣ tᵢ) gives the amount credited to Cⱼ. The numerator combines these weighted counts for the target word and adds 1. The denominator combines the weighted counts of all vocabulary entries and adds |V|, the total of those added counts. This smoothing gives vocabulary entries some probability even when their observed counts for the class are zero.
P(Cⱼ) = [1 + ∑ᵢ₌₁^|T| P(Cⱼ ∣ tᵢ)] / [|S| + |T|]
P(Cⱼ) is the updated prior for class Cⱼ. The sum uses the current assignments of all |T| tweets to that class, where i indexes the tweets and tᵢ is the tweet at index i. The numerator adds 1 to the resulting total for the class. The denominator adds the size |S| of the polarity set to the tweet count |T|. A completely assigned tweet contributes its full weight to its known class. An unlabeled tweet contributes fractions based on its current scores. Adding the class priors across the classes gives 1.
P(Cⱼ ∣ tᵢ) = { 1 if tᵢ carries seed label Cⱼ, 0 otherwise }, for tᵢ ∈ Tₗ
Tₗ is the labeled seed collection, and ∈ means that tᵢ belongs to it. Cⱼ is the polarity under consideration. The braces give the two possible values of the assignment, 1 for the seed's assigned class and 0 for the other. For seeds, P(Cⱼ ∣ tᵢ) represents a fixed training assignment. These values are used first to estimate parameters on the seeds alone and then again on every combined update. For the unlabeled tweets in Tᵤ, the probabilities come from the current classifier and can change from one iteration to the next.
Repeat the updates and select the new training examples
The paper describes tweet likelihoods in terms of a mixture over the polarity classes. In this expression, the likelihood attached to a tweet is obtained by adding up the possible ways the classes could have produced its words.
P(T ∣ θ) = ∏ₜᵢ∈T [∑ⱼ∈S P(tᵢ ∣ Cⱼ) P(Cⱼ)]
P(T ∣ θ) is the likelihood of the text collection T under parameters θ. The outer product runs over the tweets tᵢ in T, and the inner sum runs over class indices j in S. P(tᵢ ∣ Cⱼ) is the likelihood of the word tokens in tᵢ under class Cⱼ, computed from the word probabilities. P(Cⱼ) is the prior for the same class. The product treats tweets as separate observations and combines their individual likelihoods. This is the paper's expression for the text likelihood marginalized over class. The training instructions separately enforce the known seed assignments when updating the parameters.
log L(θ ∣ T) = log P(T ∣ θ) = ∑ₜᵢ∈T log [∑ⱼ∈S P(tᵢ ∣ Cⱼ) P(Cⱼ)]
L is the likelihood regarded as a function of θ for fixed data T, and log denotes a logarithm. Taking the logarithm turns the product across tweets into a sum. Each term still contains the log of a sum over the two classes indexed by j. The inner terms P(tᵢ ∣ Cⱼ) and P(Cⱼ) are the class-conditional tweet likelihood and the class prior. Thus this expression keeps all candidate classes in the likelihood without first assigning a single winning class to each unlabeled tweet.
The authors invoke Jensen's inequality to motivate using a weighted complete-data expression. The class assignments work as weights on the log of the joint likelihood of the tweet and the class. In effect, the completed data would consist of words together with labels. The calculation averages over the possible labels for an unlabeled tweet using the current assignments and uses the fixed label for a seed tweet.
log L꜀(θ ∣ T) = ∑ₜᵢ∈T ∑ⱼ∈S P(Cⱼ ∣ tᵢ) log [P(tᵢ ∣ Cⱼ) P(Cⱼ)]
L꜀ denotes the complete-data likelihood in the paper's notation. The sums run over tᵢ in T and over j in the polarity set S. P(Cⱼ ∣ tᵢ) is the assignment weight, fixed for seed tweets and computed in the E-step for unlabeled tweets. The product P(tᵢ ∣ Cⱼ) P(Cⱼ) is the joint probability of the tweet and class under the parameters being assessed. The log acts on this product, and each log term receives its class assignment weight. A seed contributes through its known class. An unlabeled tweet can contribute through both classes. This weighted sum and the preceding log of a mixture are distinct quantities. The former is the quantity the paper's procedure monitors for convergence.
Once the updates converge, the authors compare the two probabilities for each candidate from DATASET1. They want additions whose assignments strongly favor one polarity. A large absolute gap meets this requirement equally well for a highly positive or a highly negative tweet.
Tₙ = {t ∈ Tᵤ : |P(Cₚₒₛ ∣ t) − P(Cₙₑg ∣ t)| > ε}
Tₙ is the set of new training examples, and t is an individual tweet drawn from the unlabeled set Tᵤ. The colon inside the braces introduces the condition for membership. Cₚₒₛ and Cₙₑg denote the positive and negative classes. P(Cₚₒₛ ∣ t) and P(Cₙₑg ∣ t) are their final probabilities for t. The vertical bars around the difference take its absolute value, so the test concerns the size of the gap regardless of which class wins. ε is the empirical threshold, allowed to range from 0 to 1. The authors set it at 0.98 to retain very strongly polarized candidates. The expanded corpus combines the accepted tweets, labeled according to the favored polarity, with the original seeds.
The confidence rule has a different function from the fractional weighting in the updates. During fitting, the expansion pool helps estimate the parameters, including tweets whose scores have little separation. When the finished corpus is assembled, the threshold determines which of those tweets receive new training labels. A borderline case can contribute to parameter estimation and still be left out of the resulting corpus. The threshold measures the classifier's preference between two permitted categories. Human agreement about whether the tweet is an opinion is a different quantity, measured separately in the evaluation.
Get the tweets ready for the downstream classifiers
The evaluation uses Naive Bayes and maximum entropy classifiers. Naive Bayes represents how commonly each word occurs under a class and how common the class is. A maximum entropy classifier learns how the observed features support the categories for the prediction task. It is a downstream alternative to Naive Bayes. The expansion loop itself uses Naive Bayes in both seed conditions. A Maximum Entropy Approach to Natural Language Processing
The main features are unigrams, a type of n-gram that consists of individual tokens. The authors use the presence and frequency of words. They choose this representation for its coverage and relatively low sparsity, meaning that individual words are more likely to occur frequently enough to supply training evidence than longer, more specific sequences. They also cite earlier sentiment classification work as support for using unigrams. Thumbs Up?
Before training and testing these classifiers, the authors describe filtering out links, account mentions, retweet markers, and punctuation. They lower-case the text and reduce repeated characters to single characters. For tokenization, they split at whitespace. They replace abbreviations with their expanded forms and join a negation term to the next word. Joining those tokens preserves a local relationship in a representation that otherwise uses individual words. For example, a token formed from a negator and a word of approval can carry different classification evidence from the approval word by itself. This downstream preprocessing is distinct from the rule that reverses polarity around negation when making lexicon seeds.
Experiments and results
The corpora produced by the competing methods
The lexicon route produces LEX-DATA, and the clustering route produces CLS-DATA. Each consists of labeled seeds plus tweets accepted from the expansion pool. For LEX-DATA, the corpus statistics record 135,490 positive seeds and 1,180,506 newly added positive tweets, for a reported positive total of 1,315,996. They record 1,419,438 newly added negative tweets and a negative total of 1,519,235. The negative seed count is internally inconsistent. The discussion of seed construction gives 99,979, while the corpus statistics give 99,797. The paper describes LEX-DATA as a collection of around 2.8 million opinion tweets.
For CLS-DATA, the positive class starts with 325 seed tweets and gains 1,332,741 tweets, for a reported positive total of 1,333,066. The negative class starts with 194 seed tweets and gains 1,160,387, for a reported negative total of 1,160,581. The authors describe the collection as around 2.4 million opinion tweets. Both expansion runs therefore produce large numbers of confident assignments. In the clustering condition especially, most of the final labels come from the iterative classifier because the seed set is so small.
The emoticon baseline, EMOTDATA, uses happy and sad faces to collect positive and negative tweets from DATASET1 and DATASET2. Its reported size is 276,970 positive tweets and 103,740 negative tweets. This is another automatically labeled corpus. Its source of supervision differs from the lexicon and clustering routes, which gives the evaluation a reference point for asking whether the expansion procedures generate a better supply of training examples than direct emoticon matching.
The full collection sizes show the output of corpus construction. The downstream comparison asks a further question about the usefulness of the labels. For those tests, the researchers draw training samples of matched size so that a classifier using the larger source collection does not automatically get more training tweets. For polarity, they also match the counts within the positive and negative classes. For extraction, they use the same neutral tweets in each training condition.
What the human judgments establish
The authors collect the test tweets using topic words they expect to attract discussion. The subjects cover areas including telephone services, public transport, people, films, technology, and news. The test collection includes 94 tweets about telephone operators, 53 about public transportation, 67 about films, and 214 categorized as news. These are subject categories. The counts describe what the tweets discuss independently of their polarity labels.
The examples in the paper illustrate both the classification task and the need for preprocessing. One author of a tweet praises a telephone service in connection with free internet. Another complains about waiting for public transport and criticizes its management. A film reaction expresses enthusiasm through emphatically elongated spelling. A retweeted traffic report describes a fallen tree and congestion. The film reaction and the report have very different purposes even though both are short social media messages. The examples also show why a tweet's topic by itself gives limited guidance about whether the writer is evaluating something.
Two annotators independently categorize each tweet as positive, negative, or neutral. Their agreement reaches a kappa of 0.95. Kappa takes agreement expected by chance into account, so the figure measures consistency between the annotators rather than classification performance. The authors use the agreed label when the annotators match and ask a third annotator to decide the remaining cases. The final set contains 202 positive, 132 negative, and 303 neutral tweets, for 637 total.
The two tests use these human judgments in different ways. For opinion extraction, both positive and negative count as opinionated, giving 334 opinion tweets and 303 neutral tweets. For polarity, the 202 positive and 132 negative tweets supply the test cases, and the neutral tweets are excluded. The polarity experiment is consequently an evaluation among tweets already judged to express an opinion. Its accuracy measures how frequently the classifier gets the direction right in that setting.
Finding opinion tweets
For extraction, all the training conditions use the 12,614 news-account tweets as the non-opinion class. Each adds a random sample of 12,614 opinion tweets, drawn from the collection appropriate to that condition. In the baseline those come from EMOTDATA. In LEX-METHOD and CLS-METHOD they come from LEX-DATA and CLS-DATA, respectively. The learning problem is binary. The positive and negative corpus labels serve as a common opinion label for this experiment.
The paper reports precision, recall, and F1 on DATASET4. Precision asks how many tweets selected as opinions actually receive an opinion label from the human annotators. Recall asks how many of the annotated opinions the classifier finds. F1 combines precision and recall through their harmonic mean. It gives a lower score when performance on either side is weak, which matters if a system finds most of the genuine opinions only by selecting too many neutral tweets, or makes reliable selections while leaving much of the relevant material behind.
Opinion extraction F1 on the DATASET4 test set
The lexicon-based corpus leads with either classifier, and maximum entropy gives the highest F1.
The numbers
| System or setting | F1 % |
|---|---|
| Emoticon baseline with Naive Bayes | 66.21 |
| Emoticon baseline with maximum entropy | 76.56 |
| Lexicon expansion with Naive Bayes | 69.80 |
| Lexicon expansion with maximum entropy (this paper) | 80.91 |
| Clustering expansion with Naive Bayes | 56.77 |
| Clustering expansion with maximum entropy | 70.78 |
The lexicon condition improves both precision and recall within each classifier family. For Naive Bayes, the emoticon baseline gives 75.47% precision and 58.98% recall. Training on the lexicon expansion raises those measures to 76.24% precision and 64.37% recall. For maximum entropy, the baseline yields 78.36% precision and 74.85% recall. The lexicon-based condition gives 81.90% precision and 79.94% recall. The higher F1 scores therefore accompany improvements in the reliability of the selected tweets as well as in the share of reference opinions found.
The clustering condition has a different precision and recall pattern. With Naive Bayes it gives 73.11% precision and 46.40% recall. With maximum entropy it gives 80.00% precision and 63.47% recall. In the latter comparison, precision is higher than for the corresponding emoticon classifier, while recall is appreciably lower. The overall F1 ranking reflects that loss of coverage. Even though the clustering expansion produced plenty of tweets from which to draw a training sample, the eventual classifiers miss more of the opinions in the test set than their counterparts trained on emoticon labels.
Distinguishing positive and negative opinions
The polarity experiment uses the entire emoticon corpus as its baseline training set. Each expansion-based condition uses a random sample matching the baseline's 276,970 positive tweets and 103,740 negative tweets. All conditions therefore use the same positive and negative training counts. These samples serve a different role from the extraction samples, where the two training classes are opinion and non-opinion. Here the classifiers have to distinguish the two directions of opinion and train without the news-account neutral examples.
The test uses the manually judged opinion portion of DATASET4. The metric is accuracy, the fraction of these tweets for which the classifier assigns the correct positive or negative label. The positive and negative test classes have different sizes. Accuracy reports the overall share correct across them, so the chart gives evidence about performance on their observed mixture.
Polarity accuracy on the opinion tweets in DATASET4
Lexicon expansion yields the highest accuracy with each classifier, while clustering expansion trails the corresponding emoticon baseline.
The numbers
| System or setting | accuracy % |
|---|---|
| Emoticon baseline with Naive Bayes | 74.85 |
| Emoticon baseline with maximum entropy | 73.35 |
| Lexicon expansion with Naive Bayes | 81.13 |
| Lexicon expansion with maximum entropy (this paper) | 86.82 |
| Clustering expansion with Naive Bayes | 42.81 |
| Clustering expansion with maximum entropy | 45.80 |
Within each classifier family, the lexicon route wins the comparison under matched training counts. Its strongest score comes from maximum entropy, at 86.82% accuracy, while the corresponding emoticon score is 73.35%. The ordering of the classifier families depends on the training source. Naive Bayes gives the higher polarity accuracy on the emoticon corpus, while maximum entropy gives the higher accuracy on the lexicon and clustering corpora. The extraction results favor maximum entropy for each training source, giving the authors a basis for describing it as generally effective in their experiments.
Together, the experiments give two kinds of evidence about lexicon expansion. The corpus statistics show that it can assign labels to many tweets beyond the initial seeds. The matched comparisons show that a sample of those labels, mixed with any seeds drawn from the expanded collection, can teach a classifier more effectively than the corresponding sample of emoticon labels on this test. The tests assess the corpora through what classifiers learn from them. A separate estimate of the correctness of individual training labels would answer a different question.
What the ablations show
Changing how the initial labels are obtained
The paper leaves individual components unablated and offers controlled comparisons of seed construction, corpus source, classifier, and training size. Its clearest comparison changes how the seeds are made while keeping the expansion procedure in place. Both the lexicon and clustering routes start from DATASET2, draw candidates from DATASET1, and use Naive Bayes with expectation–maximization to assign polarity scores. Both supply enough accepted tweets for the matched downstream training samples. The large difference in their downstream results points to the importance of what the expansion starts from.
The authors attribute the lexicon route's advantage to the prior sentiment knowledge in the opinion words. That explanation is consistent with the results. Words whose polarity is established in advance can anchor the distinction that the procedure later tries to propagate. The comparison also changes the seed sizes and the selection rules. The lexicon approach starts with far more positive and negative labels than the clustering approach. The evidence therefore supports the lexicon procedure as a whole. The relative contributions of seed count, label reliability, and vocabulary coverage remain open.
The clustering result is revealing because the output size might otherwise look like evidence of successful expansion. A starting set of 325 positive and 194 negative tweets leads to around 2.4 million retained examples. There is ample agreement within the fitted classifier's own probabilities to pass the confidence screen repeatedly. Downstream accuracy still trails the baseline for polarity, and F1 trails it for extraction. This contrast between corpus volume and test performance shows that a large gap between the positive and negative scores is evidence of the classifier's confidence. Its value as a label depends on the training signal from which those probabilities were learned.
Changing the source and the downstream classifier
Comparing each expanded collection with emoticon matching changes the way the training labels are obtained. The matched sample sizes make this comparison informative about corpus source. The lexicon route improves both tasks with both classifiers. The clustering route has the opposite effect on the principal metrics. Those patterns show that the favorable comparison is specific to the stronger seed-and-expansion route. A claim that expansion generally improves on emoticon matching would exceed these results.
The use of two classifiers makes it possible to ask whether the ranking of the training sources depends on the final learning algorithm. For both extraction and polarity, the corpus ranking on the main metric stays the same within each classifier family. The sizes of the gains and the relative standing of the classifiers vary. This matters because Naive Bayes has two different jobs in the paper. It expands both seed corpora and also serves as one of the downstream classifiers. The maximum entropy results show that the value of the lexicon-based labels can carry over to a different downstream learning procedure even though the labels were expanded with Naive Bayes.
The emoticon baseline also helps clarify the scope of the comparison. Its labels come from explicit markers, and the classifiers then train on preprocessed text. The preprocessing removes punctuation. Accordingly, the baseline is a comparison with a corpus selected by markers, rather than merely a test of spotting happy and sad faces in the evaluation tweets. The words that tend to accompany marker-selected training examples can teach the downstream classifier. The lexicon expansion offers a different sample of sentiment-bearing text for that same purpose.
Changing how much lexicon-based data is used
The authors also vary the amount of training data for polarity classification. They focus on LEX-DATA because it performs best in the preceding tests. At each size they take equal numbers of positive and negative examples, so the balance of the two classes stays fixed while the training size changes. This is a different setup from the main matched comparison, which preserves the emoticon corpus's unequal positive and negative counts. The size experiment asks how adding examples from the lexicon-based source affects learning under a balanced design.
The authors describe a general benefit from larger training sets. They also report a drop in Naive Bayes accuracy at the largest size shown. The paper proposes noise in the automatic labels as a possible explanation. Label noise is plausible because a tweet's polarity is assigned by the corpus construction process, and the paper acknowledges that its training data are imperfect. The curve shows a drop at that setting. Diagnosing which tweets caused the drop, or determining whether the same pattern would recur across other draws of the training data, would require evidence beyond the reported comparison.
These analyses support a practical reading of the results. Training size matters, the way an example acquires its label matters, and the learning algorithm affects how the resulting corpus is used. The design can identify a successful combination of those choices on the test data. It leaves the effect of the expansion step by itself open because there is no matched downstream comparison using the original lexicon seeds alone.
Limitations
Limits the authors state
The authors explicitly acknowledge that the automatically constructed training data can contain noise. They raise this issue when examining the decline in Naive Bayes accuracy at the largest training size. Their account treats noise as a possible cause, leaving the error mechanism unresolved. The finding that more training data generally helps is therefore compatible with an observed case in which enlarging the training sample corresponds to worse performance.
The authors also recognize a coverage limit in emoticon-based collection. Tweets can convey sentiment through their words without including a smiling or sad face, so marker matching can reach only part of the desired material. Their expansion procedure broadens the search by using word features. Their own confidence rule also selects a subset, strongly favoring messages for which the classifier separates the two polarities. The authors' stated purpose for the threshold is to obtain highly polarized tweets.
Finally, the authors identify feature choice as an open direction. Their downstream results concern classifiers using unigrams under the described preprocessing. They suggest investigating other features for detecting sentiment in Indonesian tweets. The results establish that their corpus can support the reported word-based classifiers, with the usefulness of additional representations left for further work.
Limits that follow from the design
The automatic labels are evaluated through downstream performance. Human judgments apply to the test set, while the validity of individual labels in the expanded corpora remains unmeasured. It is possible for a training corpus to contain errors while still producing a useful classifier, because some associations survive noisy labels. It is also possible for a corpus to be rich in easy examples and weaker on messages whose interpretation requires more context. The test scores summarize the downstream results on the sampled tweets and leave both properties of the training collection open.
The expansion classifier has only positive and negative classes. A neutral post in DATASET1 still receives probabilities on those two classes, since that is the choice the scoring formula permits. If some vocabulary strongly favors a class under the fitted estimates, a neutral post could pass the confidence condition. The threshold addresses uncertainty between the two polarities. It supplies no independent test that a candidate expresses an opinion. This distinction is especially relevant when the newly labeled tweets become positive examples of opinion in the extraction experiment.
The lexicon seed procedure has a complementary coverage limit. It begins with tweets containing words in the inventory and uses a local negation rule. That gives it useful initial knowledge while anchoring the learned vocabulary in messages that the rule can already reach. Expansion can discover additional words when they occur alongside known evidence. A strongly opinionated pattern whose words rarely overlap with the available training signal could still be difficult to recover. The experiments compare aggregate results, with no breakdown of how the procedure handles lexicon coverage, new expressions, or examples with ambiguous polarity.
The neutral class is also a proxy in training. Selected news portal tweets serve as neutral examples because the authors expect such posts to resemble headlines. Style and publication source can differ between those posts and messages from individual users. A word that marks the style of a news report could become evidence for neutrality regardless of its relevance to subjectivity. Each extraction condition uses the same neutral training set, which helps isolate the relative contribution of the opinion sources. How well the extraction classifier recognizes neutral messages in other styles remains an open question.
The manually labeled test set gives clear reference judgments, with a kappa of 0.95 and an adjudication procedure. Its topic-word collection also shapes what it measures. The test posts span several domains, but the category sizes vary, including 214 news tweets and 12 technology tweets. The reported scores combine those domains, leaving any variation in performance among them unmeasured. The original collection comes from a specified period and uses geographic and language filters. Transfer to another period, another collection process, or another distribution of topics would require its own evidence.
The scope of the polarity score is particularly important for anyone reading the paper as a study of a two-stage system. In the polarity test, human labels determine which tweets count as opinions. A deployment that feeds the output of the extraction classifier into the polarity classifier would experience extraction mistakes as well. Some genuine opinions would be missed before polarity could be predicted, and some tweets without opinions would reach the polarity classifier. The reported accuracy measures polarity given a human-identified opinion. It leaves the combined performance of the two decisions on an unfiltered test stream open.
Finally, matched counts support a fair comparison of the particular training runs, but repeated runs would give additional information about sensitivity to which tweets were sampled. The authors describe random selection and report point scores. Variation across training draws, uncertainty around the test metrics, and the effect of alternative confidence thresholds remain unquantified. The lexicon and clustering comparison also changes several properties of the seeds together. The evidence identifies the lexicon route as the stronger procedure in the reported setup while leaving the influence of each property unresolved.
What came after
NaijaSenti cites the Indonesian study and takes up corpus building for Twitter sentiment in a different setting, a Nigerian multilingual one. The connection is the need to establish a collection of tweets that can support sentiment classification in the languages of interest. Wicaksono and colleagues approached that need by propagating labels from Indonesian seeds and testing the resulting training material against human judgments. NaijaSenti's stated subject extends the corpus-building problem to a multilingual setting. The citation establishes a connection between the works, while the extent to which NaijaSenti adopted the Indonesian study's labeling and expansion procedure is unspecified. NaijaSenti
The other citing work addresses sentiment analysis for low-resource languages. Its connection to Wicaksono and colleagues is the training resource problem: useful text can exist in quantity while the labels needed to learn a task remain scarce. The Indonesian experiments give a concrete case in which the quality of an automatically built corpus depends on how its starting labels are obtained. The citation places that case in the broader discussion of sentiment analysis under resource constraints. The citing work's specific use of the seed construction, the iterative scoring, and the evaluation procedure is unspecified. Sentiment Analysis for Low-Resource Languages
Cite
Cite as Alfan Farizki Wicaksono, Clara Vania, Bayu Distiawan and Mirna Adriani. 2014. Automatically Building a Corpus for Sentiment Analysis on Indonesian Tweets. Proceedings of the 28th Pacific Asia Conference on Language, Information and Computing.
@inproceedings{wicaksono2014automatically,
title = {{Automatically Building a Corpus for Sentiment Analysis on Indonesian Tweets}},
author = {Alfan Farizki Wicaksono, Clara Vania, Bayu Distiawan and Mirna Adriani},
booktitle = {Proceedings of the 28th Pacific Asia Conference on Language, Information and Computing},
year = {2014},
url = {https://aclanthology.org/Y14-1024/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/wicaksono-2014-automatically-building-corpus-sentiment-analysis/