Interpretable Emoji Prediction via Label-Wise Attention LSTMs
Paper · 2018 · Francesco Barbieri, Luis Espinosa-Anke, Jose Camacho-Collados et al.
Summary
A short message can give several reasons to choose an emoji. A tweet about friendship can express general affection while also naming a particular relationship. An emoji predictor that represents the tweet with a single set of word weights has to use that same emphasis for every candidate. Barbieri and colleagues ask what changes when each emoji can draw on a different part of the message. Their approach makes it possible to inspect which words receive the most weight for a particular emoji, including a candidate the system considered but ranked below its final choice. That is the paper’s starting point for interpretability.
The system first reads the whole tweet in both directions and produces a representation at each word position. It then calculates a separate set of attention weights for each emoji. The same word representations can therefore contribute differently to different candidates. Each candidate gets a score from its own weighted representation of the tweet, and the scores are converted into a single probability distribution. The expensive part of reading the tweet is shared across the candidates.
On the English split of the SemEval emoji prediction task, with 20 labels, shared attention records the highest reported F1, at 34.11. Label-wise attention records the lowest coverage error, at 3.82. Coverage error measures how far down the ranked suggestions a reader must go, on average, to find the recorded emoji. Label-wise attention leads on both F1 and coverage error in the expanded settings with 50, 100 and 200 labels. In the 200-label setting, the comparison with shared attention also shows that the ranking advantage is concentrated among less frequent emojis.
The examples explain what that advantage can look like. In a tweet contrasting friendship with sisterhood, the shared-attention system favors emojis related to the broad theme, while the label-wise system gives sisterhood enough emphasis to put the recorded emoji in 4th position. Other examples show how the same mechanism can highlight a plausible clue for a wrong prediction or associate an ambiguous word with different emojis. The weights provide a way to inspect how the system builds evidence for each candidate. The experiments establish how well that evidence recovers the emoji used in the tweet, and the examples suggest how particular associations may help or mislead the predictor.
Deep dive: Interpretable Emoji Prediction via Label-Wise Attention LSTMs
Label-wise attention helps an emoji predictor identify clues for each candidate and rank infrequent emojis higher in Twitter experiments. · about 32 minutes to read
The problem and its context
An emoji is part of the message
The paper treats emojis as part of the meaning of short, informal writing. Social media messages can include hashtags, mentions and signals about where or by whom something was posted. Their wording can be brief enough that an emoji supplies an important part of the intended reading. Some emojis convey or reinforce a feeling. Others point to a subject such as food, sport or a scene. An emoji predictor has to account for both kinds of use when its candidates include symbols for things as well as symbols for reactions.
The authors frame prediction as a way to ask what a system has learned about these uses. Give it a tweet and ask which emoji most likely accompanies the text. A successful answer can come from recognizing a named object, picking up on a tone or connecting an expression with a recurring situation. Those routes leave different clues in the tweet. A prediction score can tell researchers how frequently a system retrieves the observed emoji, while an inspection of the words can help them ask which route produced a particular result.
There are practical reasons to care about the prediction itself. The paper mentions suggesting emojis during composition, generating social media content that includes them and supporting information retrieval. It also describes links to sentiment and emotion research and the recognition of irony. The earlier Deepmoji work used emoji occurrences to learn representations for related tasks. In this paper, the emoji itself is the immediate prediction target, which lets the authors examine the text associated with particular symbols. Deepmoji
Predicting an observed emoji also poses a different problem from looking up a word in a dictionary. Several symbols may suit the same tweet, and a symbol can have both a literal use and a use tied to a situation. In the benchmark, the author’s recorded choice supplies the answer for scoring. That choice defines a repeatable comparison across predictors even when a reader could defend another suggestion. The resulting task is a form of text classification with a pre-defined set of categories and a ranked answer for each message.
From comparing symbols to explaining predictions
The earlier work discussed by the authors gives several ways to investigate emoji meaning. Similarity datasets help researchers study relationships among symbols. Sentiment lexicons associate emojis with evaluative information. These resources describe properties of emojis across uses. The question here is more specific to a particular prediction. When a system assigns a high score to a given emoji in a given tweet, which word positions did it emphasize to reach that score?
The paper also describes earlier work that trained a recurrent predictor for emoji classification. It used a long short-term memory network, or LSTM, which processes a sequence while maintaining a state that changes as it reads. In the earlier comparison, this predictor did better than a logistic regression baseline that averaged word vectors. It also exceeded human judgments in some scenarios, as the authors report. Averaging gives every position a role in a combined representation, and recurrence gives the system a way to carry information from one position to the next. The new question concerns how those contextual representations contribute to individual output labels.
A shared benchmark gives this question an experimental setting. In the emoji prediction task described by the SemEval organizers, the system receives a tweet and tries to recover an associated emoji from an established inventory. Holding the inventory and evaluation data fixed gives the paper a basis for comparing several predictors, while expanding the inventory lets the authors see how those comparisons change when there are more candidates. The multilingual shared task supplies the benchmark context for the paper’s English experiment. SemEval Multilingual Emoji Prediction
Why use a different reading for each candidate?
The authors take attention from a line of research that had already used it to select information from sequences. An attention mechanism calculates weights over positions, giving the system a way to combine the position representations according to their relevance. In the paper’s account of earlier work, additive and multiplicative attention were among the approaches developed for machine translation. It also cites self-attention for sentence representations and attention for document classification. Those examples place its design within a broader effort to make a text representation depend on where useful information occurs. Additive attention for neural machine translation · Multiplicative attention for neural machine translation · Structured Self-attentive Sentence Embedding · Hierarchical Attention Networks
The version of attention used as the paper’s starting point assigns a single weight to each position and pools the tweet once. From that pooled representation, separate output parameters can still give different scores to different emojis. The shared pooling is the important constraint. If a candidate depends on a clue that receives little weight in the pooled representation, its output parameters have to work with whatever trace of that clue survives. Conversely, for a researcher inspecting the pooling, a high weight says that the position mattered to the common representation without identifying the candidate for which it was most useful.
The authors want to ask a candidate-specific question at the point where the tweet is pooled. A word about weather may help one emoji, and an expression of hope may help another. A set of weights for each label lets the system make those selections separately. It also gives the researcher a distinct display for both candidates, even when they compete for the same final answer.
One way to create that ability would be to train a separate recognizer for each emoji, with its own sequence encoder. The authors identify computational cost and overfitting as reasons to share that work. Their design keeps a common recurrent reading of each tweet and gives each emoji its own way to draw evidence from that reading. The classification remains a choice among competing emojis, with an intermediate operation that resembles asking a separate question about each one.
The method, step by step
Read the tweet before scoring any emoji
The architecture starts with the word-based recurrent encoder used in Deepmoji. An encoder turns a sequence of words into numerical representations. Here those representations are built at the level of word positions, so the subsequent attention operation can select information from throughout the tweet. The same sequence of representations is available to every candidate emoji.
The encoder stacks bidirectional LSTM layers. In a bidirectional layer, recurrence runs in both directions through the input. The system can therefore represent an early word using information from later words, as well as represent a later word in light of earlier ones. Stacking means that a later layer can work with contextual representations already produced by an earlier layer. The base architecture also has skip connections between the recurrent layers, giving information a more direct route across the stack. The paper keeps this recurrent architecture as its starting point and changes the attention applied to the resulting states.
A position’s hidden state is the vector the encoder makes available at that point. Calling it a representation of a word is convenient, provided that the surrounding text stays part of the picture. The state at boarding, for instance, belongs to that position in a particular tweet. Its information comes from processing the sequence that contains it. If attention gives that position substantial weight, the scoring stage receives a larger contribution from the contextual state anchored there.
Keeping a state for every word makes attention possible. A classifier that summarized the whole message before this stage would already have committed to a single representation. Here the system can wait until it has a question about relevance, then use the whole collection of states to form the representation it needs. In the label-wise version, the candidate emoji supplies the context for that question through parameters learned specifically for the label.
How label-wise attention ranks emoji candidates
The steps in order.
How shared attention pools the tweet
The shared-attention version begins with a linear score for each position. The score tells the system how strongly the state at that position should contribute to the pooled representation. The operation has the same parameters at every word position.
zᵢ = wₐ · hᵢ + bₐ
Here i indexes a word position. The vector hᵢ is the recurrent hidden state at that position. The vector wₐ contains the learned attention weights for scoring the components of a state, and the centered dot denotes their dot product. The term bₐ is a learned scalar bias, added with +. The subscript a identifies the attention parameters. The resulting scalar zᵢ is the unnormalized attention score, with = defining how it is obtained. The state and the attention vector have the same dimension, which the paper denotes by d.
The scores become weights through a softmax over the input positions. In this operation, each score is exponentiated and then divided by the sum of all the exponentiated scores in the tweet. The resulting weights are positive and sum to one. A position’s weight thus expresses its share of the attention within that tweet.
αᵢ = exp(zᵢ) / ∑ⱼ₌₁ᴺ exp(zⱼ)
The symbol αᵢ is the weight assigned to position i, and zᵢ is that position’s score. The function exp applies the exponential. The slash denotes division. In the denominator, ∑ adds the terms for positions j from 1 through N, where N is the number of words in the tweet and zⱼ is the score at position j. The equality defines a weight relative to all the position scores for the same input.
Normalization has a practical consequence for reading the weights. The value at one position depends on the scores at the other positions as well as by itself. A position can be prominent in a tweet because few other positions receive comparably strong scores. The weight gives its relative contribution to pooling. The output stage still has to read the content of the state that receives that weight.
s = ∑ⱼ₌₁ᴺ αⱼ hⱼ
The vector s is the pooled representation of the tweet. For each position j, the scalar attention weight αⱼ multiplies the hidden-state vector hⱼ. The summation sign ∑ adds those weighted vectors from position 1 through N, the number of words. The equality defines s as the resulting weighted average, with the normalization already supplied by the preceding equation.
The representation stays in the same vector space as a word state. Its components combine information across positions, so a word with a high attention weight can have substantial influence on this representation. In shared attention, that representation is supplied to every emoji’s output computation. Each emoji already has its own output parameters, even though all of them receive the same input vector.
βₗ = w_f,ₗ · s + b_f,ₗ
The index l identifies an emoji label. The scalar βₗ is its score before conversion to a probability. The vector w_f,ₗ and scalar bias b_f,ₗ are the output parameters for label l, with f identifying the final scoring stage. The vector s is the pooled tweet representation. The dot forms the dot product, + adds the bias, and = defines the score. Different labels can therefore respond differently to the features in the same pooled tweet.
The last operation normalizes over the candidate emojis. This is a separate softmax, over a different set of items. The earlier softmax distributed weight over the words that build the tweet representation. The final one distributes probability over the emojis that could be predicted.
pₗ = exp(βₗ) / ∑ᵣ₌₁ᴸ exp(βᵣ)
Here pₗ is the predicted probability for label l and βₗ is its score. The function exp exponentiates that score. The slash divides it by a sum, marked with ∑, that runs over the label index r from 1 to L. The symbol L is the total number of candidate labels and βᵣ is the score of candidate r. The equality defines the probability of label l relative to the scores of all the candidates.
This gives shared attention the flexibility to interpret a common representation differently for each candidate. The point at which it pools the words remains common. The label-wise architecture moves label dependence into that earlier operation as well.
How each emoji gets its own representation
Label-wise attention changes the score for a position by giving the attention stage separate parameters for each label. The encoder still produces the state for a position once. Several scoring vectors can examine that same state and find different features relevant.
zᵢ,ₗ = wₐ,ₗ · hᵢ + bₐ,ₗ
The scalar zᵢ,ₗ is the unnormalized attention score for position i when considering label l. The vector hᵢ is the hidden state from the shared encoder. The vector wₐ,ₗ and scalar bₐ,ₗ are the attention parameters belonging to that label, with a identifying their role. The dot takes the dot product of the attention vector and the state, + adds the bias, and = defines the resulting score. The label index appears on the attention parameters and score, while the same hᵢ remains available for every label.
The next operation compares these scores across the words separately for each emoji. A candidate can emphasize a particular position regardless of whether a different candidate also wants to emphasize that position. The two distributions are normalized independently.
αᵢ,ₗ = exp(zᵢ,ₗ) / ∑ⱼ₌₁ᴺ exp(zⱼ,ₗ)
The weight αᵢ,ₗ belongs to position i for label l. The function exp exponentiates the corresponding score zᵢ,ₗ. The slash divides by the sum, denoted by ∑, over positions j from 1 to N, where N counts the words. Each denominator term uses zⱼ,ₗ, the score for position j under the same label l. The equality defines the distribution over positions for that particular candidate. There is a separate distribution for each label.
The system can now pool the same word states in a different way for each candidate. A candidate whose weights favor an expression of hope receives a representation with a larger contribution from that part of the tweet. Another candidate may derive more of its representation from a word about the weather. Both representations are built from the same recurrent reading.
sₗ = ∑ⱼ₌₁ᴺ αⱼ,ₗ hⱼ
The vector sₗ is the pooled representation used to score label l. The summation sign ∑ adds the contributions of word positions j from 1 through the tweet length N. A contribution is the shared hidden state hⱼ multiplied by the scalar weight αⱼ,ₗ assigned to that position for label l. The equality defines a separate weighted average for the candidate through those weights.
Each candidate’s output parameters act on the vector produced for that candidate. The scoring operation has the same form as in shared attention. Its input now depends on which label is being scored.
βₗ = w_f,ₗ · sₗ + b_f,ₗ
The scalar βₗ is the score for emoji label l. The vector w_f,ₗ and scalar b_f,ₗ are the final scoring parameters for label l, identified by the subscript f. The vector sₗ is the tweet representation pooled for that label. The dot forms a dot product, + adds the bias, and = defines the score from those terms.
The final softmax puts the candidates back in direct competition. It compares all their scores even though those scores come from different pooled versions of the same tweet.
pₗ = exp(βₗ) / ∑ᵣ₌₁ᴸ exp(βᵣ)
The probability pₗ is the prediction for label l. The function exp exponentiates the label score βₗ, and the slash divides it by the sum indicated by ∑. That sum runs over the index r from 1 through L, the number of candidate emojis, taking the exponent of each score βᵣ. The equality defines one probability in the distribution that will be used to rank the emojis.
The authors compare the label-specific computations to small binary classifiers because each branch can focus on evidence about its own emoji. The output equations qualify that analogy. A candidate’s final probability depends on all the other candidates, so its branch contributes a score to a multiclass decision. The architecture learns separate ways to pool the words while sharing the recurrent parameters used to read them.
What the training signal can teach the attention
The data associate a tweet with a target emoji from the active inventory. This supplies a label for the whole tweet. The attention equations give the predictor a trainable route from word positions to the label score, so it can learn to place weight on states useful for predicting that label. The observed association supplies the target for prediction. The paper describes no accompanying annotations telling the system which words expressed the emoji or which phrase justified it.
The official experiment draws its data and target inventory from the SemEval task. The expanded experiments use a Twitter corpus for settings with larger inventories. Each inventory determines which labels need their own attention parameters and which label scores enter the final normalization. Changing that inventory alters the classification problem as well as the number of attention branches. It can introduce rarer labels and alternatives that compete with candidates already present.
The paper describes its architecture and the sources of its evaluation data more fully than its training schedule. It also makes reproduction code and additional visualizations of attention on tweets available. Within the method itself, the path from the recurrent states to a prediction is explicit enough to determine what an attention display represents. For a selected label, the display maps the pooling weights back to the word positions. A display of shared attention shows one such pattern for the tweet. A display of label-wise attention can show how that pattern changes with the chosen emoji.
A labeled attention display is available even for a candidate that finishes low in the ranking. The system computes weights for every label before it compares their final scores. A concentrated pattern therefore does not imply a strong prediction. It tells the reader where that candidate drew most of its representation. The output score and the competition with other labels determine how likely the final prediction is.
Experiments and results
The official benchmark and the larger inventories
The English split from the 2018 SemEval shared task for emoji prediction serves as the primary benchmark. The predictor receives a tweet and ranks candidates drawn from the task’s pre-defined set of 20 emojis. The target for evaluation is the associated emoji. The paper marks the 20-label result group as the official setting and places the expanded inventory results alongside it.
The supplementary experiments use a dataset of roughly 100 million tweets with geolocations in the United States and posting dates between October 2015 and May 2018. The results include inventories with 50, 100 and 200 labels. The figure of around 100M describes the corpus from which the expanded experiments are drawn. It gives the scale of the source collection, while the result rows describe the particular label inventories on which the systems are compared.
The expanded inventories serve a purpose beyond adding difficulty. An architecture with label-specific attention has a separate route for evidence about each candidate, so larger inventories give the authors a chance to examine how the method handles emojis used less often. They also affect the ranking metrics directly. With more possible labels, there are more places at which the recorded emoji can appear. Comparisons among architectures within the same inventory address the effect of replacing the attention operation more directly than comparisons of raw scores across inventories.
What each comparison holds in view
FastText is the official SemEval baseline used for comparison. The paper also evaluates a stack of bidirectional LSTMs without attention and a version with shared attention derived from Deepmoji. The proposed version uses label-wise attention. The recurrent variants give the authors comparisons closer to the architectural change itself, since the base recurrent design is the starting point for both attention variants.
The no-attention recurrent system provides a reference for adding an explicit weighting of word positions. The shared-attention system is the direct comparison for asking whether that weighting should depend on the target label. FastText situates the recurrent variants against the benchmark baseline. These comparisons address somewhat different questions, so a gap to FastText and a gap to shared attention carry different information.
How the scores read a ranked answer
The paper reports F1, accuracy at rank cutoffs and coverage error. F1 combines precision and recall. Precision concerns the proportion of predictions for a class that are correct, and recall concerns the proportion of the class’s recorded examples that are recovered. F1 gives a way to consider those aspects together. The paper labels this result column F1, so the results below retain that designation.
Accuracy at rank 1, abbreviated A@1, checks whether the first suggestion is the observed emoji. Accuracy at rank 5, or A@5, checks whether the observed emoji is among the first 5 suggestions. The distinction has a practical reading. A system that inserts a single emoji needs the first candidate to be right, while a suggestion list can still include the user’s choice even if another emoji appears above it. The benchmark reports both cutoffs.
Coverage error, or CE, looks at the depth required to cover the recorded answers. The paper defines it as the average number of ranked labels needed to include all the true labels. With one recorded emoji per evaluated tweet, this is the average position at which that emoji is found. Lower values are better. This statistic can register an improvement whenever the observed emoji moves closer to the front, even if it stays beyond the cutoff used for A@5. A@5 can in turn highlight a change that matters specifically for a bounded suggestion list.
The authors include coverage error because several emojis can be plausible in similar contexts. When a predictor puts another plausible emoji first, it is useful to learn where the recorded one appears. Coverage error asks that ranking question over the full candidate list. It treats the recorded label as the target throughout, so its added information concerns retrieval depth instead of the semantic acceptability of alternatives.
The SemEval English results
On the official 20-label split, FastText records F1 of 30.97, A@1 of 42.57, A@5 of 72.45 and coverage error of 4.56. The recurrent system without attention records F1 of 33.52, A@1 of 45.76, A@5 of 75.54 and coverage error of 3.88. These results establish that the recurrent baseline is already ahead of FastText on the reported measures for this split.
The shared-attention variant records F1 of 34.11 and A@1 of 46.11, the highest values on those measures in the official comparison. Its A@5 is 75.68 and its coverage error is 3.86. Label-wise attention records F1 of 33.51 and A@1 of 45.94. Its A@5 is 76.02 and its coverage error is 3.82, the best results on those two ranking measures for this split.
The official result therefore depends on which use of the ranking matters. Shared attention performs best when judged by F1 or by the first suggestion. Label-wise attention performs best for finding the target within the first 5 suggestions or within the shallowest average depth. Those findings can occur together because changes below the first position contribute to some metrics and have no effect on others.
Results with larger candidate sets
In the 50-label setting, the no-attention recurrent system records F1 of 19.07, and shared attention records 19.83. FastText records 18.04. Label-wise attention leads the comparison with F1 of 20.08. It also has the highest A@1, at 25.64, and the highest A@5, at 53.77. Its coverage error is 9.26, compared with 9.35 under shared attention.
In the 100-label setting, the ordering again depends on the metric. Label-wise attention records the highest F1, at 17.92, and the lowest coverage error, at 15.17. Shared attention records F1 of 17.56 and coverage error of 15.51. The no-attention recurrent system records F1 of 17.44 and coverage error of 15.24. At the two accuracy cutoffs, the no-attention recurrent system leads, with A@1 of 23.01 and A@5 of 47.46. Label-wise attention records 22.80 and 47.41 on those measures. Thus the improvement in average depth occurs alongside a slight disadvantage against that baseline at the reported cutoffs.
In the 200-label setting, label-wise attention records F1 of 16.91, A@1 of 21.39, A@5 of 43.35 and coverage error of 23.73. It leads each of the reported measures in this setting. The F1 comparison includes shared attention at 16.30, the no-attention recurrent system at 16.16 and FastText at 13.31. On coverage error, the corresponding values are 24.60, 24.68 and 51.06. The two charts present the systems on these separate measures for the same expanded inventory.
F1 on the expanded Twitter evaluation with 200 emoji labels
Label-wise attention records the highest F1 among the compared systems.
The numbers
| System or setting | F1 |
|---|---|
| FastText | 13.31 |
| Stacked bidirectional LSTMs without attention | 16.16 |
| Stacked bidirectional LSTMs with shared attention | 16.30 |
| Stacked bidirectional LSTMs with label-wise attention (this paper) | 16.91 |
Coverage error on the expanded Twitter evaluation with 200 emoji labels
Label-wise attention reaches the recorded emoji at the shallowest average rank.
The numbers
| System or setting | coverage error |
|---|---|
| FastText | 51.06 |
| Stacked bidirectional LSTMs without attention | 24.68 |
| Stacked bidirectional LSTMs with shared attention | 24.60 |
| Stacked bidirectional LSTMs with label-wise attention (this paper) | 23.73 |
The repeated finding across label inventories is the coverage-error result. Label-wise attention gives the lowest value in every comparison shown. F1 also favors it in all the expanded settings, with the official split as the exception. Accuracy at the first and fifth positions gives a more varied picture, including the advantage for the plain recurrent system at both cutoffs with 100 labels. The experimental case for the proposed architecture is strongest when success includes bringing the recorded emoji up through the ranking, especially with larger candidate sets.
These aggregate measures do not identify which labels account for the differences. A gain in coverage error can come from helping familiar labels across many tweets or from rescuing labels that otherwise rank far down the list. The paper follows the headline comparison with an analysis by emoji frequency and examples that show the word weights for individual candidates.
What the ablations show
Removing attention and changing its scope
The paper compares a recurrent encoder with attention removed, with conventional shared attention and with label-wise attention. The progression tests the addition of a position-weighting mechanism and the decision to make that mechanism label-specific. This is the closest comparison to an architectural ablation. The paper also reports analyses of ranks and attention weights, which show where the systems behave differently.
On the official split, adding shared attention gives the recurrent system its best F1 and first-choice accuracy. Replacing shared attention with label-wise attention then gives the best depth and top-list results. In the expanded settings the label-wise variant leads on F1, while adding shared attention by itself produces less consistent changes in ranking. For instance, with 100 labels the plain recurrent system has lower coverage error than the shared-attention variant, and the label-wise variant has the lowest value. On this metric, the decisive change in that setting is the ability to pool positions for an individual label.
The comparison supports a claim about the complete label-wise design. It changes the specialization of the attention computation and the number of attention parameters together. It also changes the representation sent to each label’s output scorer. The reported comparisons measure the combined effect of those changes. The example-level analysis offers a way to examine the behavior that specialization was meant to enable.
Where the advantage falls in the frequency distribution
The paper compares the ranks produced by the two attentive recurrent systems in the 200-label setting. It organizes the emojis by frequency from most common to least common and plots the average rank difference for each. The plotting convention assigns lower differences to cases in which the label-wise system places the target nearer the top. That makes it possible to see whether gains are distributed across the label inventory or cluster in a particular region.
The reported pattern changes around the middle of the frequency ordering. Towards the infrequent end, the figure increasingly favors the label-wise variant relative to the shared-attention variant. This is more direct evidence about infrequent emojis than the aggregate F1 and coverage-error values alone. The comparison asks where an individual target appears under both systems and connects that result to the target’s position in the frequency ordering.
The authors interpret the pattern in terms of how specific an emoji’s typical use may be. Some infrequent emojis may appear in a narrow range of situations, where a particular word supplies a strong clue. Frequent emojis can express more general themes and may fit several readings of the same tweet. Label-wise attention gives a distinctive clue a route to the score of the emoji it supports, even when the shared attention distribution emphasizes a different part of the message.
That explanation is a hypothesis about why frequency and ranking move together in the figure. The figure orders emojis by frequency and records how the ranking changes. It does not separately measure how specific each emoji’s uses are. The interpretation gains plausibility from the examples, which offer concrete cases of a narrow clue competing with a broad reading.
A broad theme and a more specific clue
The friendship and sisterhood example makes the distinction visible. The tweet describes friendship as something that develops over time and contrasts it with sisterhood as a bond already given. Love and friendship are reasonable themes for the tweet, and the shared-attention predictions follow them. The recorded label corresponds to a more specific reading of the text. For that label, the proposed system gives substantial attention to the position of sisterhood.
The label-wise predictor places the recorded emoji in 4th position. That qualifies as a success on A@5, while the first-choice metric still treats the tweet as a miss. According to the authors, the recorded emoji ranks among the least frequent 10% of emojis in the dataset. The example thus illustrates both the frequency story and the choice of ranking metrics. A narrow association can lift a rare candidate into a practical suggestion list while leaving a more general association at the top.
The weight at sisterhood also helps explain what is being selected. The score uses a recurrent state from the position in its full sentence context. The same attention display singles out a word that a reader could identify, while the computation can include information from the contrast with friendship and the rest of the tweet. This is the sense in which the visualization makes a contextual computation easier to inspect.
Clear clues, ambiguity and a plausible error
In the snow-day example, the writer hopes for a snow day the following day. The attention visualizations highlight associations involving praying and, for another candidate, snow. The first word can be evidence for the expression of hope or prayer. The second names a concrete part of the situation. Both appeared in the same input, giving the label-specific distributions the opportunity to focus on different reasons an emoji might fit.
The example shows the value of looking at attention for several candidates, even when a user would ultimately choose one. The candidate associated with an attitude towards the event can draw its representation from a different position than the candidate associated with the event’s subject. In a shared diagram, those clues have to coexist in a single distribution for the tweet. In a label-wise diagram, the prominence of each clue can be examined in the context of the emoji it supports.
The snowboarding example shows how an intelligible association can produce a mistake. The tweet talks about taking up snowboarding and trying it at night. In the error discussed by the authors, a candidate at rank 1 receives strong attention around second. The authors suggest the system may have treated the ordinal as a clue for an enumeration of completed tasks, a usage pattern they describe on Twitter. In this tweet, the word belongs to a description of someone’s experience. The attribution gives a concrete hypothesis about the mistake, with the attention display as evidence for what drew the candidate’s weight.
The same tweet also supplies the word boarding. The authors connect attention for different high-probability candidates with different senses of that word. This is a further reason to examine candidates individually. A single word can offer evidence for several interpretations, and separate attention distributions can make those competing associations visible. The example shows what the system associated with a position, while the tweet supplies the context in which a reader can judge those associations.
The attention map also helps distinguish an explanation of the architecture from a claim about language understanding. The branch for a candidate performs a particular weighted pooling of the input states, and that pooling can be inspected directly. A human description such as an enumeration or a sense of boarding is an interpretation of the resulting pattern. The paper uses that interpretation to make the error intelligible and to identify an association worth investigating.
Looking across tweets for recurring associations
The authors extend the inspection beyond a single message by examining words with high average attention for a given emoji. This shifts the question from what drew weight in one tweet to what repeatedly draws weight when a particular candidate is evaluated. Such a view can bring out uses that a simple description of the depicted object might miss.
An example associated with a tree shows attention to words about a literal tree as well as to words about Christmas and holidays. The paper reads these as different usage patterns for the same symbol. The holiday association helps explain why a branch may look for words about an occasion even when the depicted object is absent from the message. The literal association shows how the same branch can also respond directly to words about the object.
For another emoji, the paper reports the highest-attention words in the order game, boys and football. That ranking makes the association with boys visible alongside language about the activity the emoji depicts. The authors relate this to earlier work on gender stereotypes in emoji usage. The attention statistic concerns the language the system uses in prediction. It provides a way to identify a social association in the predictor for closer examination. Gender and skin tone modifiers in emoji semantics
The corpus-level averages and the highlighted tweets answer complementary questions. Average weights show recurring associations for an emoji across uses. Individual examples retain the context in which a word was interpreted and the rank the candidate received. The frequency analysis gives those observations a separate quantitative counterpart by showing which parts of the inventory tend to benefit. Together they describe where performance changes and what some of those changes look like in the text.
Limitations
Limits identified by the authors
The authors present the method as a first step toward improving recurrent prediction on data with uneven label frequencies. They point to earlier work in which tuned support vector machines performed better than recurrent systems on emoji prediction. The comparisons in this paper include FastText and recurrent variants, so their scope is the relative behavior of those systems. The earlier result explains why improved recurrent performance in the paper’s comparison leaves a broader comparison with tuned support vector machines open.
The authors also treat interpretability as a matter of degree. The label-specific weights help them examine predictions and formulate explanations for particular successes and errors. The evidence they present is exploratory. The highlighted examples illustrate phenomena ranging from explicit cues to figurative associations and mistakes. The averages show recurring associations worth investigating. The paper’s quantitative evaluation measures prediction quality, and its interpretive evaluation proceeds through these analyses.
Applications to other linguistic properties of social media writing and to other multiclass or multilabel tasks are left for future work. The architecture evaluated here uses a final softmax over an emoji inventory, making candidates compete for probability within that inventory. A task in which several labels can all apply independently would raise a further design and evaluation question. The emoji experiments establish the behavior of the multiclass system the authors actually tested.
Limits of what the setup establishes
The evaluations judge recovery of an observed emoji. A system can rank a sensible substitute highly and receive no credit for that substitute under the reported measures. Conversely, recovering the observed emoji establishes agreement with the recorded outcome for the tweet. Coverage error softens the emphasis on the first suggestion by considering the full ranking, while keeping the observed emoji as the answer. The experiments therefore measure retrieval of recorded choices rather than agreement with a range of acceptable emojis judged by readers.
The language and collection choices also bound the results. The official evaluation uses the English portion of a multilingual task, and the expanded corpus consists of tweets geolocalized in the United States during the stated collection period. The evidence directly concerns those data and their label inventories. Its application to other languages, other social media settings or different collections of emoji usages remains an empirical question. The multilingual scope of the shared task gives a wider context for the work, while the paper’s own benchmark analysis stays with its English split.
The paper gives around 100M as the scale of the expanded corpus. It describes the experimental inventories and the metrics, while leaving many details that would determine the effective sample for a particular label outside the results discussion. Coverage by class, the number of examples reaching each evaluation split and the stability of the rankings across repeated training would help assess how much confidence to put in smaller gaps. The table gives point results. Claims about the direction of those reported comparisons are more directly supported than claims about how precisely their sizes would recur.
Frequency is central to the paper’s most distinctive claim, yet frequency alone does not explain the mechanism. In the 200-label analysis, less common emojis tend to receive more favorable ranks from label-wise attention. The authors’ account invokes the specificity of their typical situations. Demonstrating that account separately would require a measure of how situational a label is and a comparison that can distinguish that property from frequency. The rank analysis establishes the observed relationship, and the examples show how the proposed explanation can fit particular cases.
The recurrent comparisons likewise test a package of changes. Giving each emoji its own attention parameters increases the number of learned parameters at that stage and changes the way the candidate representations are constructed. A comparison that controlled attention capacity separately could further isolate the effect of label-specific pooling. As conducted, the comparison answers whether the full label-wise architecture performs better on the reported metrics and produces the candidate-specific displays the authors sought.
How far a highlighted word explains a decision
There are several steps between a highlighted word and the probability assigned to an emoji. The weight acts on a contextual state, the weighted states are combined, and the output parameters score the resulting vector. The final probability also depends on the scores of all other candidates. Attention exposes the weighting stage of that sequence. A large value at a word position therefore tells the reader where the candidate obtained a large share of its pooled representation, with the importance of the vector’s contents to the score determined by the later scoring operation.
Removing or replacing a highlighted word could change its own state, the states at other positions and the weights assigned throughout the tweet. The paper’s figures observe weights in the original inputs. They do not measure those possible changes. A test of how predictions respond when individual clues are altered would address a different question about how necessary the clues are to the decision. The displays here support explanations grounded in the architecture and generate hypotheses about that stronger form of dependence.
The averaged weights also describe the predictor’s associations under the data it saw. Attention to boys in the reported example gives evidence about how the system represents text for that emoji. The statistic leaves open how users intend the symbol, how representative those uses are across communities and what produced the association in the first place. The earlier study on gender stereotypes supplies context for the authors’ interpretation. The predictive analysis itself measures attention in the emoji task.
Finally, the capacity to highlight a plausible clue applies to wrong answers as well as right ones. The explanation around second is valuable precisely because the association is legible while the prediction is wrong. A persuasive reading of a highlight and a correct ranking are separate outcomes. The paper provides evidence for both through different means, using ranked evaluation for prediction and close reading of examples for the interpretation of attention.
What came after
The later citations take up the two aspects joined in this paper, making a text classifier easier to inspect and using tweets to predict emojis. They extend in different directions. One is a survey of explainability in natural language processing. The other studies emoji prediction for Hindi tweets using a federated approach. Their citations show how the paper connects to both lines of work. The titles and citation relationships establish the scope of those connections, with the details of architectural reuse and experimental comparison left open.
Emoji prediction as an explainability example
The survey by Danilevsky and colleagues addresses explainable artificial intelligence for language processing. The connection is the use of attention to reveal something about how a text classifier reaches a label. Barbieri and colleagues attach a position distribution to each candidate emoji, so a reader can inspect a specific output instead of treating a tweet’s attention pattern as a single explanation for its ranking. The survey’s citation places that design in the broader literature on explaining language systems. Survey of Explainable AI for Natural Language Processing
The design provides a concrete distinction for that broader subject. A display about the whole input, and a display about the evidence pooled for a particular candidate, answer different questions. This paper implements the latter in the prediction computation itself. Its analyses then show why the distinction matters when multiple labels are plausible, when a lower-ranked label is of interest or when a seemingly sensible association leads to an error. The survey is a later point of connection for that interpretability contribution.
Emoji prediction in Hindi tweets
Gandhi and colleagues cite the paper in work on predicting emojis in Hindi tweets. The shared task at the level of the research question is to use the wording of a tweet to predict an emoji associated with it. The later study changes the linguistic setting and puts a federated approach at the center of the method. That moves the application beyond the English benchmark examined by Barbieri and colleagues while retaining emoji prediction as the problem. A Federated Approach to Predicting Emojis in Hindi Tweets
The connection is best understood at the scope established by the citation. The Hindi study continues tweet-based emoji prediction in a different language and with a different methodological emphasis. Its citation leaves open whether it reuses the candidate-specific attention equations or tests the same ranking measures. The two later works thus follow separate parts of the original contribution. One situates candidate-specific inspection in the literature on explainability, and the other takes the emoji prediction problem into a new linguistic setting.
Cite
Cite as Francesco Barbieri, Luis Espinosa-Anke, Jose Camacho-Collados, Steven Schockaert and Horacio Saggion. 2018. Interpretable Emoji Prediction via Label-Wise Attention LSTMs. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{barbieri2018interpretable,
title = {{Interpretable Emoji Prediction via Label-Wise Attention LSTMs}},
author = {Francesco Barbieri, Luis Espinosa-Anke, Jose Camacho-Collados, Steven Schockaert and Horacio Saggion},
booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
year = {2018},
doi = {10.18653/v1/d18-1508},
url = {https://doi.org/10.18653/v1/d18-1508}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/barbieri-2018-interpretable-emoji-prediction-label-wise/