Elamur Research

BB_twtr at SemEval-2017 Task 4: Twitter Sentiment Analysis with CNNs and LSTMs

Paper · 2017 · Mathieu Cliche

Summary

A program that classifies tweets by sentiment has to do more than recognize familiar words of praise or criticism. It also has to decide which words matter together, and sometimes it has to judge what the writer says about a particular topic. Mathieu Cliche’s BB_twtr system tackles these problems for the English portion of SemEval-2017. The competition asks for judgments about individual tweets as well as estimates of how sentiment is distributed across groups of tweets. A system can therefore be evaluated both on the labels it assigns and on the proportions it estimates. Sentiment and emotion

The paper’s method gives word embeddings, numerical representations of words, a different job at each stage of training. The system first learns them from 100 million unique unlabeled English tweets. It then uses 5 million tweets marked positive and 5 million marked negative by a rule based on emoticons. These approximate labels help distinguish words such as good and bad, which can appear in similar contexts in spite of expressing opposite judgments. Finally, the system adapts the embeddings to the examples labeled by people for the competition. Both kinds of network in the submission start the final stage with embeddings from the emoticon-based training.

The submission combines 10 convolutional neural networks, or CNNs, and 10 bidirectional long short-term memory networks, or LSTMs. A CNN searches for useful patterns in windows of neighboring words. An LSTM processes words in sequence, carrying information from earlier steps, and the bidirectional arrangement reads the tweet in both directions. Each network produces a set of probabilities for the sentiment categories. The system averages those probabilities, retaining information about uncertainty when it estimates the sentiment distribution of a group. For tasks that specify a topic, it also marks topic words and appends any topic words absent from the tweet.

BB_twtr placed first on the official metric for every English subtask, sharing first place with DataStories on subtask A at a macro-averaged recall of 0.681. On held-out test sets from earlier competitions, the comparisons generally favor retaining both the emoticon-based training stage and the extra weight given to less frequent classes. They also show a limit to the ensemble advantage. On the 2015 test set, its positive-and-negative average F₁ of 0.679 exceeded the previous best score of 0.671, while the paper’s individual Word2vec CNN with filter widths [3,4,5] scored 0.688. The official rankings establish how the combined submission performed. The historical tests offer a narrower view of which choices helped it.

Deep dive: BB_twtr at SemEval-2017 Task 4: Twitter Sentiment Analysis with CNNs and LSTMs

See how BB_twtr used convolutional and recurrent networks, unlabeled tweets, and emoticons to classify sentiment at SemEval-2017. · about 38 minutes to read

The problem and its context

From word counts to judgments about tweets

The paper starts from a practical feature of sentiment analysis. A reader can understand the task almost immediately, and a simple procedure such as counting positive and negative words can already give useful results. A count treats a word as evidence of polarity, the direction of a judgment towards approval or disapproval. It gives the same contribution to the word wherever it appears. The research question is how much a system can gain by learning what the words do in combination and by training on more data than people can feasibly label for the competition. At the level of an individual tweet, this is a problem of text classification.

The paper gives public events and tweets about publicly traded companies as examples of why people might want such a system. Someone monitoring reactions during a debate or an awards ceremony may be interested in the distribution of opinions across many messages. Someone following a company may want to know whether a message expresses a favorable or unfavorable view of that company. The example of extracting trading signals is a motivation for improved classification. The competition experiments evaluate sentiment judgments and distributions, so they provide no measurement of what a trading decision would gain from them.

A single label for a tweet and a distribution for a collection answer different questions. A label answers what the system takes the sentiment of a particular message to be. A distribution answers how much of a group belongs to each sentiment category. Both can start with the same prediction procedure. Their outputs use the procedure’s evidence differently. The distinction matters when many messages are uncertain or when favorable and unfavorable errors accumulate unevenly across a group.

The subtasks ask for different kinds of answers

Subtask A asks for a judgment about the tweet as a whole. Its output has 3 categories, positive, neutral and negative. The positive and negative classes describe directions of sentiment, and the neutral class offers a separate answer when such a direction is absent under the task’s labeling rules. The classifier is trained to make a distinction among all the categories even in the historical evaluation, where the reported F₁ average covers only the positive and negative classes.

Subtasks B and C supply a topic. That changes the question because a sentiment-bearing expression in a tweet can concern something other than the supplied subject. B has 2 output categories. C has 5, and their order matters. In an ordinal task, the categories occupy positions on a scale. Predicting an adjacent category and predicting one much farther away are different errors. This is a distinction that ordinary classification can leave unexpressed when it records only whether an answer is correct.

Subtasks D and E also supply a topic, and their answers are distributions. D uses the 2-category inventory and E uses the 5-category inventory. The system must estimate each category’s share of the relevant collection. The greater number of categories in E allows a distribution to distinguish between positions along a richer scale. The evaluation can then ask how far the estimated sentiment would have to move along that scale to match the reference distribution. The task overview is the companion account of the competition’s definitions and evaluation. SemEval-2017 Task 4

These task differences make the competition more than a repeated test of whether a program can identify a positive tweet. They change the unit of evaluation, the information supplied at input, and sometimes the meaning of an error. Nevertheless, the same core network can produce the category probabilities needed in every setting. This makes the work an example of how an evaluation benchmark can ask distinct questions of a shared prediction method. The system needs a way to include the topic where one is supplied and a way to combine predictions for the distribution tasks.

The starting point in earlier work

The introduction places BB_twtr in a period when neural methods had delivered strong results on several language tasks. It cites work on dependency parsing and translation to illustrate that wider change. In those examples the object of prediction differs from sentiment, so their role in the argument is contextual. They explain why learning representations and decision rules together had become plausible across language tasks. They supply no direct comparison with BB_twtr on tweets. Dependency parsing · Machine translation

On Twitter sentiment specifically, the paper treats previous SemEval competitions as evidence that neural approaches were already competitive. The earlier UNITN entry trained a deep CNN for tweet classification. The paper also identifies that entry and the work of Deriu and colleagues as precedents for the sequence of training stages. The latter work appears in the bibliography as a convolutional ensemble using distant supervision, a procedure that obtains approximate labels from a rule or another indirect signal. BB_twtr brings that kind of training into a comparison that includes recurrent networks as well as convolutional ones. UNITN · SemEval-2016 Task 4

For the convolutional classifier itself, the paper points to Yoon Kim’s sentence classification architecture. Its organizing idea is that useful evidence can be a short pattern appearing anywhere in a sentence. For the recurrent classifier, the starting point is a network that continually updates a state as it reads. Long short-term memory adds a mechanism for controlling what the state keeps, what it accepts from the current input and what it exposes to later steps. These were established architectures when the author chose them. The experiment asks how they perform within a common training strategy and whether their probability estimates work well together. Convolutional Neural Networks for Sentence Classification

The method, step by step

Prepare the text and gather supervision

The networks work with a sequence of words obtained through tokenization. The paper applies preprocessing before each training stage. A URL becomes the common token <url>, so addresses share an input representation. Several kinds of emoticon map to <smile>, <sadface>, <lolface> or <neutralface>. A letter repeated more than 2 times in succession is reduced to 2 copies. The paper illustrates this with the resulting form soo. Lowercasing removes case differences from the word forms supplied to the networks.

Each transformation changes what the learner can distinguish. The shared URL token preserves the presence of a link while discarding its destination. The emoticon categories retain distinctions among several kinds of expression while pooling different written forms. Shortening a long run of the same letter retains a sign of elongation in cases such as soo, while treating runs of different original lengths alike. Lowercasing allows differently capitalized occurrences to contribute to the same word representation. These are decisions about the information available at every later stage, because the embeddings and the classifiers both learn from preprocessed tweets.

The starting collection is 100 million unique unlabeled English tweets gathered through the Twitter streaming API. The author draws the emoticon-labeled subset from this collection. The human-labeled data come from SemEval. The paper gives 49,693 labeled tweets for A, 30,849 for the C and E grouping, and 18,948 for the B and D grouping. The grouped counts are reported for those task pairings. They are distinct from the sizes of the historical test sets and the size of the official test set.

The stages differ in what kind of signal each example provides. In the first, the words in a tweet provide evidence about one another. In the next, an emoticon supplies an approximate label for the tweet. In the final stage, a human label gives the answer in the competition’s terms. What carries over is a set of word vectors. The recurrent classifiers can therefore benefit from learning done by the distant CNN without having to process the entire distant collection themselves.

How BB_twtr trains and combines its tweet classifiers

The steps in order.

How BB_twtr trains and combines its tweet classifiersStep 1: Normalize and tokenize the tweets1. Normalize and tokenize the tweetsStep 2: Learn embeddings from unlabeled tweets2. Learn embeddings from unlabeled tweetsStep 3: Assign approximate labels using emoticons3. Assign approximate labels using emoticonsStep 4: Adapt embeddings with a distant CNN4. Adapt embeddings with a distant CNNStep 5: Add topic information where required5. Add topic information where requiredStep 6: Train CNNs and bidirectional LSTMs on human labels6. Train CNNs and bidirectional LSTMs on human labelsStep 7: Average classifier probabilities for each tweet7. Average classifier probabilities for each tweetStep 8: Pool tweet probabilities for distribution tasks8. Pool tweet probabilities for distribution tasks

Learn word vectors from unlabeled tweets

An embedding assigns a word a point in a space of numerical features. The coordinates are learned together, which allows the network to distinguish how similar two words are along different combinations of features. Each word in a tweet can then be represented by its vector, giving the classification network numerical input while retaining the original sequence of positions. The paper chooses an embedding dimension of 200.

The author tries Word2vec, FastText and GloVe. In the paper’s description of Word2vec, the learning signal comes from predicting neighboring words. Predictive training can place words in related regions of the embedding space when their contexts are similar. The sentiment labels of the competition play no role at this stage. The input supplies enough information to create the training objective by itself. Word2vec

FastText uses a similar prediction idea and includes information from pieces of words. The distinction matters at the level of the representation. A word can inherit information through parts that it shares with other words, as well as through the contexts in which it appears. The paper considers FastText as a different choice for initializing the same later training pipeline. The comparison therefore concerns what happens after that initialization has been adapted to sentiment. Enriching Word Vectors with Subword Information

GloVe uses statistics about how frequently words occur together across the collection. This gives another route to a space of words with related uses. The paper uses the original implementations of the embedding methods with their defaults. It treats the methods as complete choices at the start of the pipeline, so its comparisons include the consequences of those defaults. The whole unlabeled collection serves as the source for this stage. GloVe: Global Vectors for Word Representation

The paper illustrates the problem with good and bad. A writer can use either in the same grammatical position and around much of the same vocabulary. Context learning may thus capture something accurate about the uses of the words while placing them too close together for a polarity decision. The next stage changes the training objective so that evidence useful for distinguishing positive from negative tweets can change the embedding coordinates.

Use emoticons to make polarity matter

The distant supervision rule follows the strategy the author attributes to Go and colleagues. A positive emoticon acts as evidence for assigning the tweet a positive label, and a negative emoticon acts as evidence for assigning a negative label. This yields 5 million examples with a positive label and 5 million with a negative one. A label describes what the rule inferred. The emoticon can signal the writer’s sentiment without accurately labeling every word, every target or even the overall message, which is why the paper describes these labels as noisy.

The author trains a CNN to predict this approximate polarity. Its word vectors start at the values learned from unlabeled text. During the first epoch, meaning a pass over the training data, those values are frozen. The classifier above them can start learning the distant prediction task while the vectors remain fixed. This is meant to avoid large initial changes to the embedding space. The author then unfreezes the vectors and trains for 6 more epochs. At that point the prediction errors can change the word vectors as well as the classifier.

This is the first round of fine-tuning. The same word now participates in a training objective that cares directly about which polarity category the tweet receives. If a direction in the embedding space helps the classifier detect evidence associated with the positive or negative label, the training can preserve or strengthen that distinction. The paper describes good and bad as farther apart after this stage. It brings the adapted vectors into the human-labeled stage, where the distinction most valuable to learn is whatever helps predict the actual competition labels.

The transition also explains how the system can use a binary training signal for tasks with a larger output inventory. The distant CNN needs to distinguish positive and negative examples. The transferred item is its set of word vectors. The final classifier learns the output categories dictated by its own task, including neutral or more finely ordered categories where appropriate. Its output layer has access to features shaped by approximate polarity and can learn how those features relate to a different set of answers.

Detect local patterns with a CNN

The convolutional path takes the token vectors as rows of a matrix. Before padding, the number of rows is the number of words, and the number of columns is the embedding dimension. Padding with zeros gives all inputs a common row dimension of 80, with 200 columns for the ordinary word vectors. A filter has the same width as the embedding matrix and spans a chosen number of word positions. Moving the filter down the input gives a response at every available window.

cᵢ = f(Σⱼ,ₖ wⱼ,ₖ X[i:i+h−1]ⱼ,ₖ + b)

Here cᵢ is the response for the window starting at position i. The slice X[i:i+h−1] is the part of the padded input matrix X that begins at i and covers h rows, ending at i+h−1. The width in words is h. The index j selects a row within the window, and k selects an embedding coordinate. The coefficient wⱼ,ₖ is the corresponding entry in the trainable filter w. The sum Σⱼ,ₖ adds the products across both indices. The scalar b is a learned bias. The function f is a rectified linear unit, which gives zero for negative input and otherwise returns its input. The symbols + and − denote addition and subtraction. The subscript on the response says which starting position produced it.

A filter can learn to respond to a pattern expressed through multiple word coordinates and multiple positions. Since the same coefficients apply as the filter moves along the matrix, the detector makes the same computation wherever the pattern occurs. This use of shared weights is what allows one filter to recognize evidence in different parts of a tweet. The paper describes the padding as making the convolutions effectively wide. Its account connects that choice to earlier work on convolutional sentence representations. A Convolutional Neural Network for Modelling Sentences

Filter width determines how many successive word positions contribute to a response. The paper tries the width sets [1,2,3], [3,4,5] and [5,6,7]. At each width it uses 200 filters, allowing multiple detectors to work over windows of the same length. In the paper’s interpretation, these filters recognize useful n-grams, or consecutive groups of tokens, in embedding space. A response can thus depend on similar word vectors in relevant positions, even if the exact sequence of spellings changes.

cₘₐₓ = max(c)

In this expression c is the list of position-by-position responses from one filter, and max selects the largest entry in the list. The result cₘₐₓ is that filter’s pooled feature. The equality defines the feature computed in this step. The subscript identifies the operation that chooses the strongest activation.

Max pooling gives the classifier a fixed amount of information from each filter. It preserves the strength of the strongest activation, wherever in the tweet it happened. The exact position and the other activations of that filter leave the representation at this point. A reader can think of the pooled vector as a set of answers to parallel questions about how strongly each learned pattern appeared. The next layer can use those answers in combination.

With the widths and number of filters used here, the pooled representation has 600 features. Those features pass through a fully connected hidden layer with 30 units to produce a smaller learned representation. Fully connected means every pooled feature can contribute to every unit of this layer. A softmax layer then converts the output scores to category probabilities. It gives each category a share of the total probability for the tweet, which is the form needed for both classification and later averaging.

While training the model, the author uses dropout with a 50% probability after each of two stages: pooling and the fully connected hidden layer. Dropout randomly suppresses activations while the network is learning. It is intended to make learning less dependent on particular activations always being available and thereby reduce overfitting, where the classifier fits details of its training examples that do not carry over to new ones. The paper adapts the architecture diagram from earlier work on the sensitivity of CNN sentence classifiers. Dropout · A Sensitivity Analysis of CNNs for Sentence Classification

Read the sequence in both directions with an LSTM

The recurrent classifier approaches the same input through successive state updates. A recurrent network reads one word vector at a time and uses the internal representation from the previous step as part of the next computation. It shares the weights of that computation across positions. By the time the network reaches the end, its final state can carry information from earlier words. The paper first gives the equation for an ordinary recurrent update to explain what the LSTM changes.

hₜ = f(Wₕ · xₜ + Uₕ · hₜ₋₁ + bₕ)

The index t is the current step in the reading order. Its word vector is xₜ, the previous hidden state is hₜ₋₁, and the updated hidden state is hₜ. The matrix Wₕ transforms the word vector into the hidden space, while Uₕ transforms the preceding hidden state within that space. The bias vector is bₕ. The subscript h on these parameters associates them with the hidden-state update. The centered dot · denotes matrix-vector multiplication and + adds vectors. The function f is a nonlinearity such as the hyperbolic tangent, also called tanh. The recurrent state dimension in the paper is 200, and the paper describes the ordinary recurrence with an initial state of zeros.

This simple update involves repeated transformations of the state. During training, the influence of a much earlier step can become very small or very large as the learning signal passes through successive updates. The paper refers to these cases as vanishing and exploding gradients. The LSTM uses a memory cell and gates that regulate the flow of information. The memory can retain selected values across steps while changing others. The paper presents the update using the notation of earlier work on recurrent network regularization. Recurrent Neural Network Regularization

fₜ = σ(Wᶠ · xₜ + Uᶠ · hₜ₋₁ + bᶠ)

The vector fₜ is the forget gate at step t. Its entries regulate how much of the old cell state is carried forward. The sigmoid σ maps each entry of its input to a value between zero and one. The current word vector xₜ and previous hidden state hₜ₋₁ are the inputs to the gate. The matrices Wᶠ and Uᶠ transform those inputs and bᶠ is the gate’s bias vector. The superscript f identifies parameters for the forget gate. The dot indicates matrix-vector multiplication and the plus signs join the contributions by vector addition.

iₜ = σ(Wⁱ · xₜ + Uⁱ · hₜ₋₁ + bⁱ)

The vector iₜ is the input gate at step t. It controls the contribution of the proposed new content to the cell. The sigmoid σ again produces elementwise gate values. The matrices Wⁱ and Uⁱ act on the current embedding xₜ and the preceding hidden state hₜ₋₁. The bias bⁱ and both matrices belong to the input gate, as indicated by their superscripts. The dot denotes multiplication of a matrix by a vector and + sums vectors.

oₜ = σ(Wᵒ · xₜ + Uᵒ · hₜ₋₁ + bᵒ)

The vector oₜ is the output gate for step t. Its entries regulate which parts of the cell state are expressed in the regular hidden state at that step. The sigmoid σ determines the gate values from a sum using the current embedding xₜ, the previous hidden state hₜ₋₁ and a bias. The matrices Wᵒ and Uᵒ transform the two inputs, and bᵒ supplies the bias. The superscript o identifies these as the output gate’s parameters. The · and + operators carry out matrix-vector multiplication and vector addition.

cₜ = fₜ ◦ cₜ₋₁ + iₜ ◦ tanh(Wᶜ · xₜ + Uᶜ · hₜ₋₁ + bᶜ)

The cell state cₜ at step t combines information kept from the preceding cell state cₜ₋₁ with newly proposed information. The operator ◦ is the Hadamard product, which multiplies corresponding entries. The forget gate fₜ scales the old values. The input gate iₜ scales the proposed values, which are produced by applying the hyperbolic tangent tanh to a sum of vectors. The matrices Wᶜ and Uᶜ transform xₜ, the current word’s embedding, and hₜ₋₁, the preceding hidden state. The vector bᶜ is the bias for the proposed content. The superscript c identifies these parameters with the cell update. The dot denotes matrix-vector multiplication and the plus signs denote vector addition, including the addition of the old and new contributions.

hₜ = oₜ ◦ tanh(cₜ)

Here hₜ is the regular hidden state exposed at step t, cₜ is the updated cell state, and oₜ is the output gate at the same step. The function tanh transforms each element of the cell state. The Hadamard product ◦ multiplies each transformed element by its corresponding gate value. The cell state and hidden state thus have different roles. The next cell update can carry forward the stored value, while the next recurrent computation receives the gated hidden value.

A single forward LSTM has access at each step to what it has encountered in its current reading direction. The author adds a separate LSTM that starts at the other end of the tweet. Each direction reads the whole sequence and contributes its hidden state after its own final word. The network concatenates those terminal states, placing their coordinates side by side, to form a representation of dimension 400. Next comes a 30-unit fully connected hidden layer, followed by a softmax output. The paper uses dropout with probability 50% during training before and after the recurrent part and after the fully connected hidden layer.

The two architectures therefore use word order differently. A convolutional feature is calculated over a window and then pooled across positions. The bidirectional LSTM builds a representation by retaining or changing state over a succession of words in each direction. Both architectures arrive at the same form of output, a set of probabilities over the task’s categories. This common output makes their predictions compatible for voting even though their internal representations differ.

Adapt to human labels and to topics

In the final stage, both architectures start with the embeddings produced by the distant CNN. The paper describes freezing those vectors for the first ∼ 5 epochs, then training for another ∼ 5 epochs with updates to them enabled. In this latter phase the learning rate is reduced by a factor of 10. The learning rate scales the size of parameter updates. The schedule allows the task-specific classifier to begin developing its own decision rule before it makes smaller adjustments to the embeddings inherited from distant training.

The objective is cross-entropy, which penalizes the classifier when it assigns low probability to the human-annotated category. The paper weights the loss by the inverse frequency of the true class. Thus an example from a less frequent class has a larger individual weight than one from a more frequent class. This changes which mistakes exert the most influence during training. It is relevant to the competition because a classifier that performs well on common categories can still be judged poorly by a measure that gives equal weight to performance on each class. Linguistic annotation

The system minimizes this weighted loss with the Adam optimizer, beginning with a learning rate of 0.001. The implementation uses TensorFlow, and the experiments run on a GeForce GTX Titan X. The size of the probability output is 3 for A, 2 for B and D, and 5 for C and E. The pairing means that a distribution task can use the same category inventory as its corresponding classification task. The difference comes when the system decides which probabilities to return and what to aggregate.

For the tasks that specify a topic, B through E, the paper makes two changes at the input. It first appends any topic words missing from the tweet. This ensures that the name supplied with the example can contribute word vectors even when the tweet uses some other way to refer to its subject. The paper then marks topic membership by attaching an extra learned vector to each word’s usual embedding. That vector has dimension 5 and is one of 2 alternatives, one for topic words and one for the other words.

Topic identity and topic membership are distinct pieces of information in this design. Appending a missing word makes the word itself available. The indicator tells the network which input positions contain topic words. A CNN can use that distinction inside its windows, and an LSTM can use it in its sequence updates. A topic word that already occurs in the message can contribute in its original surroundings. A word placed at the end contributes in its appended position. The reported justification for both operations comes from cross-validation, where the author observed an improvement in accuracy.

Combine probabilities and estimate distributions

The submission uses soft voting across 10 CNNs and 10 LSTMs. In soft voting, each classifier contributes its category probabilities. A classifier that barely favors a category therefore supplies a different contribution from one that strongly favors it. Averaging the full outputs keeps both kinds of evidence available. A vote based only on the category selected by each network would discard that distinction before combining their judgments.

The ensemble members vary in random initialization, total training duration and embedding pretraining method. Their supervised training durations range from 4 to 20 epochs in total. The CNNs can also use different filter-width sets. Word2vec and FastText provide the alternative embedding initializations in the submission. Although each member learns from the same general pipeline, these choices give the members different ways to represent the input and different paths through training.

For a classification task, the averaged probabilities support a choice among the task’s categories for the tweet. For D and E the paper applies the probability averaging approach attributed to Bella and colleagues. The basic operation is to take the probability assigned to a category for each tweet in the collection and average it across the collection. The result is the estimated share of that category. This use of probabilities allows uncertain tweets to contribute to several categories in proportion to their estimated sentiment. The relative strengths of those contributions matter directly to the final distribution.

The two averages answer separate questions. Averaging across networks combines several views of the same tweet. Averaging across tweets estimates a group’s sentiment composition. The pipeline can perform both with the same category probabilities. This helps explain why the paper’s component analysis examines correlations between probability outputs in addition to reporting how often a single network gets a decision right.

Experiments and results

Historical tests use a separate training boundary

The paper evaluates subtask A on earlier SemEval Twitter test sets to compare choices in the architecture and training. The test sets for 2013, 2014, 2015, and 2016 contain 3,813, 1,853, 2,392, and 20,632 tweets, respectively. For this historical analysis, the author excludes those test sets from the data used to train the classifiers. Their results give several views of performance under the earlier evaluation setup. In particular, the chronological labels identify different test collections, which vary considerably in size.

The metric is the mean of the positive and negative classes’ F₁ scores. For each of those classes, precision asks what share of the predictions for that class are correct, and recall asks what share of actual examples of the class are found. F₁ combines the two, favoring a classifier that does well on both. The reported average gives the positive and negative F₁ scores equal influence. Neutral tweets can still affect the score because, for example, predicting a positive label for a neutral tweet makes the positive prediction incorrect.

The paper uses this measure to match earlier competition reporting. The official 2017 subtask A metric is macro-averaged recall, which gives each class’s recall equal influence. The author reports that the two measures were highly correlated in the comparisons examined. This provides a reason to consider the historical analysis relevant to the design, while the score values still belong to their own metrics and evaluation protocols.

The simple baseline is logistic regression using 1–3 grams. It gives the comparison a classifier that has access to local word sequences through a conventional statistical representation. Its historical average F₁ scores for 2013, 2014, 2015 and 2016 are 0.627, 0.629, 0.586 and 0.558, respectively. All reported neural variants exceed that baseline on each historical set. Those comparisons concern complete systems. They say more about the difference between the tested pipelines than about the contribution of any one stage.

A separate comparison uses the best previously reported score for each historical test. These results come from the earlier competition account and are drawn from different systems across the years. They serve as a record to compare with for each test set individually. The row does not describe the behavior of one historical competitor across all four sets.

The ensemble has strong historical results, with an exception

On the 2013 test, the ensemble reaches 0.725 on the positive-and-negative F₁ average, while the previous historical best is 0.728. The best individual variants in the paper reach 0.720 there. On the 2014 test, the ensemble reaches 0.748, ahead of the historical best of 0.744 and the strongest individual entry in the comparison, the Word2vec CNN with widths [1,2,3] at 0.735. Together these outcomes show that an ensemble can lead the paper’s individual classifiers even when the previous historical benchmark remains difficult to match.

The 2015 result is the important exception to the paper’s general account of the ensemble outperforming its individual classifiers. The ensemble beats the previous historical best on that set. An individual Word2vec CNN, using widths [3,4,5], ranks above it. The comparison is useful because it shows two legitimate meanings of improvement in the same column. The ensemble improves the historical reference point, while the strongest available single classifier improves upon the ensemble’s score.

Classifiers on the 2015 Subtask A test set by positive and negative average F₁

The ensemble beats the historical record, while an individual Word2vec CNN scores highest.

Classifiers on the 2015 Subtask A test set by positive and negative average F₁Logistic regression: 0.586Logistic regression0.586Previous historical best: 0.671Previous historical best0.671Word2vec LSTM: 0.677Word2vec LSTM0.677BB_twtr ensemble (this paper): 0.679BB_twtr ensemble (this paper)0.679Word2vec CNN, widths [3,4,5]: 0.688Word2vec CNN, widths [3,4,5]0.688
The numbers
System or settingPositive and negative average F₁
Logistic regression0.586
Previous historical best0.671
Word2vec LSTM0.677
BB_twtr ensemble (this paper)0.679
Word2vec CNN, widths [3,4,5]0.688

On the 2016 test, the ensemble scores 0.648, compared with the previous best historical result of 0.633. The leading individual entry is the Word2vec CNN with widths [5,6,7], at 0.646. The ensemble leads all the individual variants on that test, but its nearest comparator comes from a different width set than the best CNN on the 2015 test. Variation in which individual setting leads is part of the reason an ensemble can be attractive across several tests even though it occasionally falls below a strong constituent architecture.

The historical comparison gives the ensemble results of 0.725, 0.748, 0.679 and 0.648 across the four sets in order. The relevant comparison within each test is with systems scored on that same collection. Comparing the ensemble’s raw results across years gives no direct measure of how the underlying task changed, since the tweets differ and the test sets have different sizes. The paper uses the columns mainly to see whether conclusions about particular design choices hold across multiple collections.

The official test evaluates the competition submission

For the 2017 test, BB_twtr is retrained using the available training material, including previous years’ test tweets. Those tweets had been held back when the author wanted to evaluate on them in the historical comparison. They can now contribute to training because the reported official result concerns the separate 2017 test set. The paper gives 12,379 tweets for that test set and reports the primary metric separately for each subtask.

On A, the official macro-averaged recall is 0.681 for both BB_twtr and DataStories. BB_twtr’s rank is reported as 1/38. The author says BB_twtr places above DataStories on the other measures mentioned for this task, accuracy and positive-and-negative F₁. The paper gives no numerical values for those secondary results. The primary metric therefore establishes a shared top result, with additional distinctions reported under the other measures.

On B, which supplies a topic and asks for a binary sentiment judgment, the system reaches 0.882 macro-averaged recall. The next submission reaches 0.856, and BB_twtr’s rank is 1/23. Macro averaging asks how well the classifier recovers each class, giving class-specific recalls equal weight. This is the same kind of measure as the official score for A, applied to a different classification task and category inventory.

SemEval-2017 Subtask B test results by macro-averaged recall

BB_twtr recovers a larger share of the sentiment classes on average than the next submission.

SemEval-2017 Subtask B test results by macro-averaged recallNext best submission: 0.856Next best submission0.856BB_twtr (this paper): 0.882BB_twtr (this paper)0.882
The numbers
System or settingMacro-averaged recall
Next best submission0.856
BB_twtr (this paper)0.882

Subtask C evaluates the ordered categories with macro-averaged mean absolute error. Absolute error uses the distance between the position of the predicted label and that of the human label on the scale. Macro averaging gives the different true categories equal standing in the final measure. BB_twtr records 0.481, the next best entry records 0.555, and the paper reports a rank of 1/15. On this metric a smaller number indicates less error.

SemEval-2017 Subtask C test results by macro-averaged mean absolute error

BB_twtr places its predictions closer to the reference categories on average than the next submission.

SemEval-2017 Subtask C test results by macro-averaged mean absolute errorNext best submission: 0.555Next best submission0.555BB_twtr (this paper): 0.481BB_twtr (this paper)0.481
The numbers
System or settingMacro-averaged mean absolute error
Next best submission0.555
BB_twtr (this paper)0.481

Subtask D uses Kullback–Leibler divergence, a measure of discrepancy between the reference sentiment distribution and the estimated one. The official score is 0.036 for BB_twtr and 0.048 for the next submission, with a reported rank of 1/15. Since this is an aggregate measure, an error in the label of a particular tweet matters to the extent that the probability estimates shift the group distribution. This score alone gives no account of how many individual labels a classifier would have assigned correctly.

Subtask E uses earth mover’s distance. It measures how much probability mass would need to move to align the estimated and reference distributions, taking account of the distance moved along the ordered categories. The paper reports 0.245 for BB_twtr and 0.269 for the next submission, with a rank of 1/12. Both distribution tasks reward smaller discrepancies, and both are estimated by probability averaging. They use different category inventories and different ideas of distance, so their score levels answer different questions.

The official table establishes the submission’s standing on each task’s own primary measure. It is evidence for a system flexible enough to rank at the top in standard classification, ordered classification and distribution estimation. The different rank denominators specify the fields for individual subtasks. The official results also put the historical comparisons in perspective. A full-system result can show that the combination works well for a task, while the historical comparisons test which ingredients help under a narrower set of conditions.

What the ablations show

Distant training generally improves the starting vectors

The historical table compares versions of the Word2vec CNN and LSTM with and without distant training. In the omitted-stage version, embeddings go directly from context-based pretraining to supervised fitting. The comparison keeps the existence of pretrained word vectors in common and tests whether using the distant CNN to adapt those vectors helps. It therefore addresses the value of the intermediate adaptation in this pipeline. It cannot separate the effects of the emoticon labeling rule from the learning procedure that trains the CNN on those labels.

For the CNN with widths [3,4,5], the complete training sequence reaches 0.715 on the 2013 test and 0.688 on the 2015 test. Without the distant stage the corresponding scores are 0.698 and 0.660. The same change lowers the score from 0.723 to 0.716 on the 2014 test and from 0.643 to 0.636 on the 2016 test. In this CNN comparison, the version with distant training leads on every historical set.

The LSTM shows a similar direction of change. Its Word2vec version with the intermediate training reaches 0.720 on the 2013 test, 0.733 on the 2014 test, 0.677 on the 2015 test and 0.636 on the 2016 test. The counterparts with the distant stage omitted are 0.698, 0.719, 0.647 and 0.629. The LSTM never learns directly from the emoticon-labeled tweets in the method as described. Its results are evidence that an embedding space adapted by the distant CNN can be useful to a classifier that processes the same words through recurrence.

These are scores on the historical positive-and-negative average F₁. Their consistency in direction supports the stage under that measure. The comparisons leave open which words account for the gains, whether some types of tweet benefit more than others, and how much of the distant collection is necessary to obtain the observed result. The opening example of polarity differences in the embedding space explains the intended mechanism. The ablation measures its practical value through the classifier’s output.

Class weighting helps on several sets and varies by year

The class weighting comparison asks what changes if examples contribute to cross-entropy without adjustments for how frequently their classes occur. With inverse-frequency weighting, a mistake on one less common example has greater influence on learning. Removing the weights makes the objective respond more to categories that supply more examples. F₁ responds to both which actual examples the classifier finds and how often the classifier’s predictions are right, so the result depends on how this change shifts category decisions.

The reference CNN scores 0.715 on the 2013 test and 0.723 on the 2014 test. Without weights, it scores 0.682 and 0.679 on those tests. The weighted Word2vec LSTM scores 0.720 and 0.733 in the same order, while its unweighted versions score 0.689 and 0.661. On the 2015 test, weighting is again favorable for both architectures. The CNN reaches 0.688 with weights and 0.659 without them. The LSTM reaches 0.677 with weights and 0.652 without them.

The 2016 test gives a weaker and less consistent result. The weighted CNN has 0.643 and the unweighted CNN has 0.640. The weighted LSTM has 0.636 and the unweighted LSTM has 0.643, reversing the ordering for that architecture. The paper summarizes class weighting as a helpful addition. The table supports retaining it across the historical tests as a group, with an exception that matters when interpreting the result as a property of the method. Equalizing the training influence of classes can help substantially under some test conditions and yield a different tradeoff under others.

The table reports aggregate scores and supplies no class-by-class precision and recall for these variants. A reader can identify which setup gives the higher F₁ average. Determining whether weighting improved recovery of a particular class, for instance, would require seeing the predictions or the class-level results. The observed performance of the weighted objective is better established here than an explanation of how it redistributes the errors.

Embeddings, filter widths and the hidden layer

The embedding comparison gives a reason why the submitted ensemble uses Word2vec and FastText and leaves out GloVe. With CNN widths [3,4,5], GloVe has lower scores than either of the other embedding initializations on all the historical tests. On the 2014 test, the GloVe CNN scores 0.714, the Word2vec CNN scores 0.723 and the FastText CNN scores 0.733. The difference concerns the end of the complete training pipeline. It reflects how each initialization fares after distant and human-labeled training.

The LSTM results are more closely grouped on some sets. On the 2014 test, for instance, both FastText and GloVe reach 0.730, alongside Word2vec at 0.733. On the 2015 test the ordering is clearer, with Word2vec at 0.677, FastText at 0.666 and GloVe at 0.658. The paper’s overall preference for the two predictive embedding methods is consistent with those comparisons. The results leave room for ties in particular settings and offer no direct ranking of the general quality of the word representations in unrelated tasks.

Changing the CNN window widths has a less uniform effect. The Word2vec CNN with widths [1,2,3] scores 0.735 on the 2014 test, ahead of the Word2vec alternatives with [3,4,5] at 0.723 and [5,6,7] at 0.732. On the 2015 test, the [3,4,5] version is strongest among those choices at 0.688. On the 2016 test, [5,6,7] leads them at 0.646. A span favorable on one set does not establish a general optimum. In the ensemble, several width sets can contribute even when their individual standings change across years.

Removing the additional fully connected hidden layer often changes the historical score only slightly. For the reference CNN the 2013 score stays at 0.715 when the layer is removed. On the 2014 test the score is 0.723 with the layer and 0.724 without it. For the Word2vec LSTM on that same 2014 test, the result is 0.733 with the layer and 0.725 without it. These cases suggest a weaker dependence on the extra layer than on distant initialization. The layer remains part of the submitted design, and the table compares the way it is configured here with omitting it.

Why probability outputs can complement one another

The paper measures how closely the classifiers’ output probabilities move together using Pearson correlation. A high positive correlation means that the probabilities tend to rise and fall together. Classifiers can have similar F₁ averages while producing different probability patterns. The correlation analysis gives the author a way to look at that difference before making the connection to soft voting. Its table covers representative CNNs and LSTMs with Word2vec and FastText initializations.

For the Word2vec CNN with widths [3,4,5], the correlation with the Word2vec CNN using [1,2,3] is 0.97. Its correlation with the Word2vec CNN using [5,6,7] is also 0.97. The correlation is 0.95 when the same [3,4,5] CNN configuration switches from Word2vec to FastText. A comparison between the Word2vec CNN with widths [3,4,5] and the FastText LSTM gives 0.91. Changing both the architecture and the embedding pretraining can therefore give less similar outputs than changing the spans of the reference CNN while keeping Word2vec.

The table also shows that a change in architecture can matter while holding the embedding choice fixed. The FastText CNN with widths [3,4,5] and FastText LSTM have a correlation of 0.92. The paired Word2vec and FastText LSTMs have a correlation of 0.95. All these coefficients describe substantial positive association. The useful point for soft voting is the variation within that association. Networks often agree, and some pairings give probabilities that differ more than others.

A correlation compares probability patterns and does not determine where agreement produces a correct answer. The ensemble’s historical scores supply a separate test of whether combining predictions improves the resulting decisions. The ensemble leads the individual variants on the 2013, 2014 and 2016 sets, while the strong CNN on the 2015 set shows what an average can give up. Correlation makes it plausible that differently trained networks can contribute complementary evidence. The score comparison shows the outcome of that combination under the metric the paper actually reports.

The topic-specific changes have less detailed evidence. The author reports that appending missing topic words and marking topic words improved accuracy in cross-validation. No scores are given for turning the two operations on and off separately. The historical variants also focus on A, which does not supply a topic. Accordingly, the cross-validation observation supports how the author chose the submitted design, while the official results evaluate that design as a whole.

Limitations

Questions raised by the author

The conclusion identifies a closer integration of convolution and recurrence as a direction for future work. BB_twtr’s CNNs learn to scan local windows, and its LSTMs learn to update a sequential state. These computations happen within separate classifiers. Their outputs meet at the probability average. The author points to the earlier system of Stojanovski and colleagues as a possible point of comparison for an architecture in which convolution and recurrence interact during the construction of the tweet representation. The paper’s experiments establish the performance of a voting ensemble and leave that architectural question open.

The author also proposes studying how performance depends on the amounts of unlabeled and distant training data. The paper reports the quantities it collected and evaluates removing the distant stage. This establishes that the complete stage is useful in the tested pipeline. A size experiment would ask how performance changes at different amounts of data or when the two collections grow at different rates. The current results offer no curve relating effort in data collection to performance, and they provide no basis for identifying a point at which adding more tweets stops helping.

Boundaries of the experimental evidence

The most detailed component tests cover historical subtask A. The historical setup excludes the earlier test sets from training and uses positive-and-negative average F₁. The official 2017 setup includes those older tweets in the training material and uses the primary metric for each subtask. Thus the results support two related conclusions at different levels. The ablations test components under a historical classification protocol. The official rankings evaluate the finished submission on the competition’s current tasks. The design has no official-score ablation for distant training, class weighting or the mixture of architectures on B through E.

Variation across the historical sets also limits predictions about which individual setting will be best on a new collection. The favorable width set changes between tests. Removing weights improves the LSTM score on the 2016 set. The ensemble has a lower 2015 score than the strongest CNN in the table. The author reports scores for the variants without uncertainty intervals or an account of repeated comparisons across random initializations for each setting. A small score gap can establish the order of the reported runs. Its stability across training runs remains unmeasured.

The baseline and the previous historical best results serve different purposes. Logistic regression offers a common simple comparison across the tests. The best historical scores show prior performance on individual test sets, with the leading system potentially changing from one set to the next. Neither comparison isolates architecture, data collection, pretraining or tuning individually. The controlled variants strengthen some particular conclusions, especially for distant training, but the official ranks cannot assign a share of the overall success to each component.

The supervision rule is another limit on what the paper establishes. Tweets with recognizable emoticons supply the labels for distant training. This selection favors tweets with those observable cues and gives no human verification of each inferred label. The paper also lists normalized emoticon tokens in preprocessing and supplies no controlled comparison that removes labeling cues from the distant inputs. The results therefore show that the intermediate procedure helps downstream, without measuring how much the distant CNN learns from other words independently of the emoticons.

Some details about the trained system’s behavior are left to aggregate measurements. The paper reports no systematic error analysis of which tweets are hard for the local-pattern classifier, which are hard for the sequence classifier or how frequently the topic indicator resolves an ambiguity. For the distribution tasks, discrepancies between estimated and reference distributions show that the system can estimate group sentiment competitively. Additional per-tweet evidence would be needed to see how individual errors combine to give those aggregate scores, or how reliable the probabilities are at different levels of confidence.

Finally, the collected tweets and the submitted results concern English. The paper’s practical examples motivate the task, but the experiments are competition evaluations on tweets. Applying the measured performance to another language, to another kind of writing, or to decisions about the events and companies mentioned in the introduction would require evidence from those settings. The paper supplies a way to build and compare classifiers for its competition data and a record of how that design performed there.

What came after

The shared task and transfer from tweet text

The contemporaneous account by Rosenthal, Farra and Nakov describes the shared task in which BB_twtr competed. It places the distinctions among ordinary classification, ordered categories and distribution estimation at the level of the competition itself. Cliche’s paper describes how one entry handled those requirements, including the change of output size and the use of probability averaging. Read together, the task account defines what the scores are intended to measure, while the system paper explains the decisions behind one submission. SemEval-2017 Task 4

BERTweet continues the interest in what can be learned from tweet text before training for a specific downstream task. Its stated focus is a pretrained language system for English tweets. BB_twtr also starts with English tweets, using them to learn word vectors that it then adapts to sentiment. The relationship is the choice to learn from the kind of text a downstream system will encounter. The later work’s title identifies pretraining on English tweets as the contribution in its own right. BERTweet

The work by Chronopoulou and colleagues approaches the surrounding question through transfer learning from pretrained language systems. Transfer learning uses knowledge acquired under one training objective to help with another. BB_twtr provides a concrete instance of staged transfer, moving word vectors from learning based on context, through emoticon-labeled sentiment, to human-labeled tasks. The later work is concerned with a simple way to transfer from an already pretrained language system. The connection is at the level of adaptation, with no established reuse here of BB_twtr’s distant CNN or its voting procedure. An Embarrassingly Simple Approach for Transfer Learning

Extending the setting and changing the classifier

The work by Barriere and colleagues turns to sentiment in non-English tweets. It names multilingual transformers and automatic translation for data augmentation, which increases training material by deriving additional examples from available text. That choice addresses the problem of obtaining useful training evidence through a different route from BB_twtr’s emoticon rule. The topic still involves sentiment on the same kind of short social media message, but the language setting and the way additional material is obtained are different. Improving Sentiment Analysis over non-English Tweets

Priban and colleagues examine Czech sentiment and ask whether multilingual systems improve it. In relation to BB_twtr, this shifts the question about a useful starting representation. Cliche’s representation comes from a large collection in the same language as the competition entry. The later study makes the usefulness of multilingual training for a particular language the subject of inquiry. Its stated scope supports the connection to sentiment and transfer across languages. It gives no basis here for assigning to Czech the patterns Cliche observed in the English historical tests. Improving Czech Sentiment with Transformers

SentimentGPT takes up sentiment analysis using GPT and frames its work around the relationship to existing machine learning approaches. Its connection with BB_twtr is the shared classification problem and the changed technical means for addressing it. BB_twtr learns the sentiment categories through supervised training of specialized networks, with word vectors that carry over from earlier stages. The SentimentGPT title places GPT at the center of the later investigation. The citation establishes a link to the earlier work without establishing a particular use of its scores or a result from a common test. SentimentGPT

Studying what sentiment signals capture

The work by Cachola and colleagues examines vulgar language and its effects on sentiment analysis in social media. It returns to the relationship between a feature in the text and the judgment a classifier is supposed to make. BB_twtr chooses to normalize several expressive features before learning its word representations. The later study singles out vulgarity as a phenomenon whose social dynamics matter to sentiment analysis. Its stated topic places attention on how expressive language is used, alongside the engineering question of how to represent it. Expressively vulgar

Random Decision Syntax Trees uses LSTMs and sentiment scores in the setting of irony detection. Here the sentiment score has a different role from the one it has in BB_twtr. In the latter, sentiment probabilities are the immediate prediction or are pooled to estimate a distribution. In the irony paper’s stated approach, sentiment scores help address a task whose answer concerns irony. That is a concrete extension of the kind of information a sentiment system can supply. The citation and title leave open whether the scores themselves came from BB_twtr. Random Decision Syntax Trees at SemEval-2018 Task 3

Cite

Cite as Mathieu Cliche. 2017. BB_twtr at SemEval-2017 Task 4: Twitter Sentiment Analysis with CNNs and LSTMs. Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/s17-2094

@inproceedings{mathieu2017bb,
  title = {{BB\_twtr at SemEval-2017 Task 4: Twitter Sentiment Analysis with CNNs and LSTMs}},
  author = {Mathieu Cliche},
  booktitle = {Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017)},
  year = {2017},
  doi = {10.18653/v1/s17-2094},
  url = {https://doi.org/10.18653/v1/s17-2094}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/cliche-2017-bb-twtr-semeval-2017-task/