A Comprehensive Analysis of Preprocessing for Word Representation Learning in Affective Tasks
Paper · 2020 · Nastaran Babanejad, Ameeta Agrawal, Aijun An et al.
Summary
A text classifier can inherit decisions made long before it sees a labeled example. If it represents words using vectors learned from a large collection of writing, choices such as which words to keep and how to handle negation affect the material from which those vectors are learned. The same choices can also be made later, when preparing the examples the classifier will use. Babanejad and colleagues ask which stage makes better use of those changes. Their question matters for affective classification, where a phrase can change polarity with a single word and where words with opposing emotional meanings can occur in much the same surroundings. The study follows those effects through learned word embeddings.
The authors train representations on news articles and Wikipedia and test them on datasets for sentiment, emotion, and sarcasm. They compare ordinary text cleanup with settings that correct spelling, rewrite some negated expressions, filter words by grammatical class, remove frequent function words, or reduce words to stems. They also examine punctuation as a separate experimental factor. A shared classification setup lets them compare three placements for the more extensive preprocessing. They can alter the large corpus before learning representations, alter only the labeled classification data, or alter both. The distinction is between changing what the representations learn and changing which expressions the classifier receives.
Among individual treatments tested on News, negation handling gives the strongest results across the datasets for both CBOW and Skip-gram. The rule replaces a negation cue and its immediate successor with an antonym when a dictionary supplies one. The strongest combinations depend on the representation and the dataset. The authors favor keeping stopwords in their overall conclusion, and the Wikipedia BERT results support that choice consistently. In the direct comparison of timing, processing the training corpus generally beats processing the classification data alone. Applying the same treatment to both sources sometimes helps further. For example, on IMDB with BERT, the weighted F-scores are 94.18 for corpus preprocessing, 94.58 for classification-data preprocessing, and 94.63 for processing both.
In the comparison with released embeddings, the authors’ preprocessed BERT representations lead on eight of the nine datasets. Reddit sarcasm is the exception, where their Skip-gram entry reaches a weighted F-score of 68.72 against 65.39 for BERT. The paper also distinguishes absolute scores from relative gains over basic cleanup. Emotion classification generally has lower absolute scores, yet the emotion datasets show the largest relative improvements in the authors’ analysis. Taken together, the findings make a case for treating the preparation of the representation-training corpus as an experimental choice with consequences for the eventual classifier.
Deep dive: A Comprehensive Analysis of Preprocessing for Word Representation Learning in Affective Tasks
Babanejad and colleagues test when text preprocessing improves word representations for sentiment, emotion, and sarcasm classification. · about 34 minutes to read
The problem and its context
When similar surroundings conceal opposite feelings
A word vector represents a word numerically so that a classifier can use relationships learned from text. One rationale is that words which repeatedly occupy similar surroundings are likely to have related meanings. For many purposes, that is a useful starting point. For affect, however, the relationship of interest can be more specific. A classifier may need to know whether two words express compatible feelings, whether an utterance conveys approval, or whether a seemingly complimentary phrase is being used sarcastically. The paper locates this tension in distributional semantics.
The authors illustrate it with happy, sad, and joy. In their example, word2vec places happy closer to sad than to joy. An adjective describing a negative feeling can appear in much the same grammatical surroundings as an adjective describing a positive feeling. A noun denoting a similar feeling has a different grammatical role and can therefore occur in different surroundings. The authors use the ranking to explain why general word similarity and affective usefulness can pull in different directions. The representation has learned a relationship from context, while the classifier has a particular reason to care about polarity. The earlier work underlying this example is Efficient Estimation of Word Representations in Vector Space.
The three tasks in the paper place different demands on that relationship. Sentiment classification distinguishes positive from negative text. Emotion classification distinguishes several emotional categories whose differences need more resolution than a polarity judgment. Sarcasm detection assigns a label to the use of an utterance, where the apparent meaning of the words can give only part of the evidence. A change to the relationship between a negated expression and a negative word might help a sentiment classifier directly. Its effect on detecting sarcasm has to be established through the labeled examples. These tasks fall within the study of sentiment and emotion.
The distinction mattered in part because the paper’s motivating applications used varied text. It mentions work on hateful comments, financial sentiment, and news recommendation. It also describes a field with abundant user-generated writing, whose conventions differ from those of edited articles. A misspelling in a post can resemble a simple transcription error, while an unusual spelling can also be part of how a writer expresses feeling. Similarly, punctuation can be irrelevant to one classification decision and informative to another. A procedure evaluated on a single genre gives limited grounds for deciding what information to retain across this range.
What earlier preprocessing studies had measured
The paper reviews earlier preprocessing studies chiefly as experiments on the material being classified. In Twitter sentiment analysis, one investigation associated a ready-made stoplist with worse classification. Other investigations reported gains from stemming or from reducing inflected words to dictionary forms, a procedure known as lemmatization. Another found that taking out stopwords, numbers, and web addresses could make the input cleaner without raising performance, while changing the treatment of negation and expanding acronyms could help. These were answers about particular systems and datasets. Their differences made it difficult to treat preprocessing as a routine with a settled effect.
Earlier emotion studies also considered transformations that preserved or explicitly marked expressive information. Some retained negative verbs and emotional words while filtering frequent words. Some expanded shortened negative forms, gave punctuation descriptive text labels, or joined a negation marker to the word it modified so the joined expression could be treated separately. The review reports gains from negation in prior work and describes findings in favor of emoticon processing for user-generated data. Results involving grammatical tags varied. The paper cites studies that used them successfully and another that set them aside after observing worse classification. The underlying procedure is part-of-speech tagging.
Text classification experiments give such choices a fairly immediate interpretation. If an experiment tags the labeled texts and keeps only selected words, the classifier sees a shorter sequence with different evidence. If it joins a negative marker to an emotional word, the classifier receives a designated expression for that construction. The representation of the surviving words can still come from a separate, earlier training run. An embedding learner trained on the transformed corpus would encounter those changes throughout its own learning material. It could learn different associations even for surviving words whose spelling never changed. These are distinct ways for preprocessing to influence text classification.
The literature on embedding training had already established that apparently modest changes to context definitions and settings can have consequences. The paper discusses experiments on window size, vector dimensionality, and the information supplied by syntactic relationships. In one study it reviews, removing stopwords helped analogy experiments, while similarity experiments responded differently. The paper draws from this literature the idea that settings have to be interpreted against the task used to evaluate them. A configuration that helps recover one kind of lexical relationship need not help identify whether an utterance expresses anger or approval. Two examples of that earlier line of work are Improving Distributional Similarity with Lessons Learned from Word Embeddings and The Role of Context Types and Dimensionality in Learning Word Embeddings.
The authors also distinguish corpus preprocessing from other routes to affect-sensitive representations. Earlier work had learned sentiment-specific vectors, enriched vectors with emotion information, adapted pretrained representations to a specific task, and revised learned vectors using lexical resources. Another approach learned from tweets containing emoji, making a signal associated with expression part of representation training. These strategies explain why changing a general representation was already a live question. Babanejad and colleagues ask what familiar text operations can accomplish when moved to an earlier point in training. Examples of the prior approaches include Learning Sentiment-Specific Word Embedding for Twitter Sentiment Classification and Learning Emotion-enriched Word Representations.
The closest earlier preprocessing studies covered narrower sets of decisions or tasks. One investigation the authors discuss considered token boundaries, lowercasing, dictionary forms, and joining multiword expressions, and found simple tokenization generally adequate for its sentiment experiments. Another assessed preprocessing for emotion classification with a frequency-based representation learned from a small tweet corpus. It reported favorable results for stemming, lemmatization, and emoji tagging. The present study widens the comparison to include different kinds of embedding, corpora, and affective classification, while making the placement of preprocessing an explicit experimental variable. Splitting text into the units passed on to later stages is tokenization.
The method, step by step
Keep the corpus and the classification data distinct
The experiment uses two sources of text for different jobs. A large corpus supplies the material from which the word representations are learned. A labeled dataset supplies examples for learning to recognize sentiment, emotion, or sarcasm and for evaluating that recognition. A review’s positive or negative label belongs to the second job. An occurrence of a word in an encyclopedia article belongs to the first. The use of separate sources makes it possible for a preprocessing rule to influence representation learning, classification, or both.
The authors call the first placement Pre. They transform the large corpus and learn representations from the transformed text. The classifier then uses those representations to encode its dataset. In Post, the representations are acquired from the corpus with basic cleanup, and the more extensive transformation is applied to the classification data. Both applies the selected treatment to the corpus and the classification data. Basic is the reference setting with ordinary cleanup. There is a vocabulary exception to the description of Pre. Whenever the training setting includes stemming, the classification text is also stemmed so its forms are compatible with the learned vocabulary.
From corpus preprocessing to affective classification
The steps in order.
Consider the paper’s negation procedure in these placements. Under Pre, each eligible replacement in the corpus changes the text from which word relationships are learned. Under Post, an eligible replacement changes the sequence presented for classification, using representations learned from the basically cleaned corpus. Under Both, the representation learner and the classifier see text treated by the same rule. In all cases, the rule can change the same linguistic construction. What differs is the point at which the consequences enter the experiment.
Begin with basic cleanup
Basic includes lowercasing, stripping HTML tags, removing numbers, and common punctuation cleanup. The paper names the NLTK regular-expression tokenizer for the punctuation operation. Lowercasing lets capitalized and lower-case instances be treated under a common spelling. The other cleanup decisions set boundaries on the characters and word forms the system will encounter. Consequently, the comparison with Basic measures additional processing on top of a prepared textual baseline.
The experimental tables also include a punctuation condition called punc. For News, the tables report it as an individual treatment and as an option left out of the combined treatment. The Wikipedia comparison includes a combined setting with punc omitted. The paper’s prose places common punctuation removal inside Basic, so the tables distinguish conditions more clearly than the procedure distinguishes their implementation. The results for punc can be read as results for the named experimental condition without assuming an extra list of character rules.
Correct spellings and rewrite eligible negations
The spelling procedure uses a dictionary built with frequencies taken from ukWac. The system identifies possible misspellings and considers candidate corrections. Where candidates compete, frequency in that corpus decides which suggestion replaces the original. The operation can consolidate variant forms under a more frequent spelling. The choice among candidates is based on corpus frequency, so the procedure uses a general preference for common words when resolving ambiguity.
Negation handling takes a further step by making a lexical replacement. The authors first compile a resource of antonyms from WordNet. They consider antonyms by synset, the grouping WordNet uses for words that share a sense. A sense can yield no antonym, a single antonym, or several candidates. For competing antonyms within a sense, the authors favor the one with the highest ukWac frequency. When choosing an antonym for a word across its recorded senses, their procedure selects a sense at random from the dictionary.
The system then looks for a negation cue in tokenized text. For each such cue, it checks the next token. When that token has an antonym in the resource, the antonym replaces both the cue and the token it followed. In the paper’s example, a sentence about how the speaker feels that day contains not happy. The intervention reduces that pair to sad. The rest of the sentence can then provide context for sad during representation learning, or surround the vector for sad in the classifier’s input. When the lookup produces no antonym, that replacement is unavailable.
This is a compact rule for converting some negative constructions into ordinary vocabulary items. Its design makes the placement comparison particularly concrete. A replacement during corpus preparation can change the contexts in which an antonym occurs across a large body of text. A replacement at classification time can make the resulting word accessible through an existing vector. That same simplicity defines the rule’s coverage. It acts on a token boundary and a lexical relation, with the next token serving as the candidate for replacement.
Filter words and reduce their forms
The grammatical filter tags the words in each sentence with NLTK and retains nouns, adjectives, verbs, and adverbs. In the paper’s tag notation these are the families NN*, JJ*, VB*, and RB*. The asterisk in each label includes the tags that begin with the indicated letters. The motivation is that these classes frequently carry affective information. The removal changes the input sequence as well as the inventory of word uses. Two surviving words can become nearer to each other once intervening material is gone, which changes the context available to an embedding learner with a limited window.
Stopword removal uses the NLTK list. It operates by word identity, while the grammatical filter selects a token by its tag in the sentence. Both can shorten the sequence, but they need not remove the same material. The paper records changes to corpus length and vocabulary separately. A frequent word may contribute heavily to corpus length, whereas vocabulary size counts it as one distinct form. That makes it possible for a filter to remove many occurrences while leaving much of the vocabulary intact.
The last operation uses the NLTK Snowball stemmer. Stemming groups word forms under a reduced stem and can therefore change the set of strings for which the system learns vectors. It also explains the need to stem classification examples under a corpus setting that includes the operation. The learner and the classifier need compatible forms even when the other suite of preprocessing steps is restricted to the training corpus. A stem can be useful as a shared representation key without serving as the dictionary form of a word. The paper’s operation is stemming.
The combined pipeline starts from basic cleanup and orders the named linguistic operations as spellchecking, negation handling, grammatical filtering, stopword removal, and stemming. The authors point out two dependencies. Negation handling needs access to negation cues before stopword filtering can remove them. The tagger also has fuller word forms available when it runs before the stemmer. As a consequence, a combined setting has both a choice of operations and a specified order. In the omission experiments, a name such as All - stop indicates the full combination with stopword removal left out.
Learn representations from the prepared corpus
The News corpus has 142,546 articles from 15 American publications, spanning 2013 to early 2018. Wikipedia is the larger source, with 23,046,187 articles. The article collections are used for representation training. The movie reviews, tweets, narratives, fairy-tale sentences, headlines, dialogue responses, and Reddit comments used for classification form separate evaluation datasets.
The corpus measurements show how different operations can alter the material available to training. For News, Basic has a vocabulary of 155K and a corpus size of 123.2M. The spell condition has a vocabulary of 149K and the same reported corpus size, 123.2M. The stem condition has a vocabulary of 137K, again with a reported corpus size of 123.2M. The pos condition keeps a vocabulary of 154K while reducing corpus size to 70.7M. These cases illustrate the difference between changing the forms in a corpus and eliminating occurrences. The Wikipedia Basic row gives a vocabulary of 5.1M and a corpus size of 8.1B. The full All treatment gives 4.6M and 5.6B, respectively. The authors discuss the potential relevance of shorter training corpora to training time.
The authors use CBOW, Skip-gram, and contextual BERT representations. CBOW, or Continuous Bag-of-Words, predicts a target word from its surroundings. Skip-gram reverses the direction of prediction. It starts with the target word and predicts its surrounding words. Both therefore learn from word occurrences and neighboring text, which is why corpus operations such as deletion and replacement can change their training signal. For these architectures on News, the minimum count is 5 and the context-window setting is 5. For Wikipedia, the minimum count is 100 and the window setting is 10. Both use dimensionality 300, meaning each learned word vector has 300 components.
BERT supplies representations that depend on the context of an occurrence, adding a different kind of learner to the comparison. The authors use the large uncased architecture and describe it as 24-layer, 1024-hidden, 16-heads, and 340M parameters. The labels describe the stack depth, the size of the hidden representation, the attention heads, and the parameter count. The paper says it follows the original parameter settings. The BERT preprocessing comparisons presented in the main results use Wikipedia. The earlier paper is BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.
The authors report 8 training runs for each representation architecture and describe the larger BERT training runs as taking up to 4-5 days each. They describe using accelerator infrastructure for representation training and release their source code and data to support reproduction. The duration is a description of their training setup. The paper’s tabulated corpus counts provide the more direct comparison of how much text the different treatments retain.
Fit the classifier with a task-appropriate loss
A long short-term memory network, abbreviated LSTM, processes the classification examples as sequences of learned representations. Its job is to combine information from the sequence into a prediction for an entire example. The authors use the same type of classifier across the representation comparisons. The output and training loss reflect the label structure. Sentiment and sarcasm use binary decisions, while emotion classification chooses among several categories.
For a binary task, the output uses a sigmoid to produce a probability for the designated positive class. Binary cross-entropy penalizes assigning low probability to the observed label. In the sarcasm task, “positive class” in this mathematical sense means the class assigned the positive indicator, independent of whether the utterance expresses positive sentiment.
ξ = −(1/N) ∑ᵢ₌₁ᴺ [yᵢ log(p(yᵢ)) + (1 − yᵢ) log(1 − p(yᵢ))]
Here ξ is the mean loss, N is the number of examples being averaged, and i indexes an example from 1 through N. The observed label yᵢ is a binary indicator. The paper’s p(yᵢ) is read in this expression as the predicted positive-class probability for example i, and 1 − p(yᵢ) is the complementary probability. The symbol log denotes the logarithm and ∑ adds the contributions of the examples. The brackets group the terms for an example. The plus sign joins them, and the leading minus sign converts the log-probability contribution into a loss. The label and its complement select which probability contributes for that example. The factor 1/N averages the contributions.
For emotion classification, the classifier uses softmax, which gives a distribution over the emotion categories. Its loss is categorical cross-entropy. It gives the lowest penalty to a prediction that assigns a high probability to the labeled category.
ξ = −(1/N) ∑ᵢ₌₁ᴺ ∑ⱼ₌₁ᵏ yᵢⱼ log(p(yᵢⱼ))
In this expression, ξ is the mean categorical loss and N is the batch size in examples. The index i runs over those examples, j indexes a category, and k is the number of categories. Each yᵢⱼ indicates whether category j is the true class for example i. The quantity p(yᵢⱼ) is the probability that the classifier assigns to that category for that example, with probabilities in the interval [0, 1]. The inner ∑ collects category contributions and the outer ∑ collects example contributions. The logarithm is again written log, and the prefactor takes the negative mean. Only the labeled category contributes through the indicator for each example.
The authors optimize the losses with Adam. They list epoch settings of 5 and 10 and batch sizes of 64 and 128. An epoch is a pass through the training material, while a batch is the group of examples used to calculate a training update. They use dropout during training, which temporarily ignores randomly selected units, and stop training early based on validation loss. The stated patience is 3 and the minimum change is 0.0001. The criterion gives the classifier a chance to continue improving while retaining a stopping rule when the validation loss stalls.
For sentiment and sarcasm, the paper uses an 80%/20% training and testing split and reserves 10% of the training portion for validation. The validation set supports training decisions such as early stopping. For emotion, the authors use stratified 5-fold cross-validation because the datasets are smaller and imbalanced. The folds rotate which portion is held out, and stratification aims to preserve the class composition across those portions. Thus the emotion scores summarize a cross-validation procedure, while the sentiment and sarcasm scores refer to the paper’s held-out test protocol.
Experiments and results
What the evaluation datasets ask the classifier to recognize
The sentiment datasets cover reviews and tweets. IMDB contains 50,000 film reviews divided between 25,000 positive and 25,000 negative examples. The two labels have equal representation there, and the writing can develop an opinion over a longer passage. SemEval contains 14,157 tweets, with 10,076 positive and 4,081 negative examples in the version used by the paper. The Airline dataset has 11,541 tweets, of which 9,178 are labeled positive and 2,363 negative. Those tweets concern six U.S. airlines. Together the datasets put the same binary decision into forms that differ in both genre and label balance. The earlier sources include Learning Word Vectors for Sentiment Analysis and SemEval-2016 Task 4: Sentiment Analysis in Twitter.
One of the paper’s airline examples is negative even though the speaker begins by describing everything as fine. The complaint follows when the speaker mentions lost luggage. The example gives a reason for using a sequence classifier after embedding the words. Individual words provide evidence, and the sequence can establish which part of the message determines the label. It also shows why there are several possible ways for preparation to affect the result. A filter may concentrate some of the strongest lexical evidence, while a representation learned from different contexts may change how the classifier uses remaining words.
The emotion evaluation covers personal accounts, fairy tales, and tweets. ISEAR contributes 5,477 examples in the subset used by the authors, drawn from accounts of experiences involving sadness, anger, disgust, fear, or joy. Alm contributes 1,206 fairy-tale sentences labeled with categories that include a combined angry-disgusted class. SSEC contributes 1,017 tweets and adds emotion annotation to an existing stance-and-sentiment collection. Its categories include surprise and fear as well as anger, joy, and sadness. These datasets give the classifier distinct ways in which emotion can be conveyed, such as reporting an upsetting encounter or describing characters’ behavior. The SSEC source is Annotation, Modelling and Analysis of Fine-Grained Emotions on a Stance and Sentiment Detection Corpus.
Sarcasm appears in headlines, argument responses, and Reddit comments. The Onion dataset has 28,619 headlines drawn from The Onion and HuffPost, with the former supplying the sarcastic examples and the latter the other class. IAC contributes 3,260 dialogue responses from the general sarcasm category of the Internet Argument Corpus. The Reddit dataset has 1,010,826 comments in the inventory. Its labels come from the writers themselves, a different route to annotation from the labeling used for other datasets. Source and annotation differences make these separate tests of sarcasm classification even though they share a binary label format. The dialogue and comment sources are described in Creating and Characterizing a Diverse Corpus for Sarcasm in Dialogue and A Large Self-Annotated Corpus for Sarcasm.
How the scores and baselines work
The reported metric is weighted F-score. The F-score combines precision, the share of predicted instances of a class that have that label, and recall, the share of actual instances of the class that the classifier retrieves. Weighted scoring gives the class-specific scores influence according to the classes’ support in the dataset. The authors use it because some of the emotion datasets have markedly unequal class frequencies. All score comparisons below use the paper’s reporting scale.
F-score = 2pr/(p + r)
Here p represents precision and r represents recall. The adjacent letters in 2pr indicate multiplication of precision and recall by each other and by the constant 2. The plus sign adds precision and recall, and the slash divides the numerator by that sum. The expression combines the two measures so that a weak value on either affects the result. The paper reports the weighted version for the datasets, instead of treating the individual class scores as interchangeable.
The experiments use three principal forms of comparison. Basic supplies the internal reference for asking whether an additional corpus operation helps. Post supplies a reference for asking whether the same kind of treatment can achieve its benefit when deferred to classification. Finally, the authors compare with released pretrained embeddings used as obtained from their repositories. That last comparison provides a practical benchmark for the resulting representations, with the resources differing in their training data, objectives, and architecture.
The released entries reported in the comparison table are GloVe, SSWE, FastText, DeepMoji, and EWE. The uncased GloVe vectors were learned from global co-occurrence counts, using the GloVe6B resource of 6 billion words from Wikipedia and Gigaword. SSWE explicitly incorporates sentiment and was trained on 10 million tweets. FastText uses sequences of characters within words, with the resource in the comparison trained on Wikipedia. These descriptions are important because the alternatives offer different reasons to expect good affective behavior. A tweet-trained representation can reflect patterns of expression found in user-generated text, while character sequences offer a way to share information across word forms. See GloVe and Enriching Word Vectors with Subword Information.
DeepMoji learned from 1.2 billion tweets containing emoji using a bidirectional LSTM, which takes sequence information in both directions. EWE learned emotion-enriched representations from a corpus of 200,000 Amazon product reviews using an LSTM. Both have a route to affective information in their learning setup. The corpus-preprocessing comparison puts them alongside representations whose training text was changed before learning. The emoji-trained baseline comes from Using millions of emoji occurrences to learn any-domain representations for detecting sentiment, emotion and sarcasm.
Moving treatment to the corpus usually helps
The direct placement experiment uses Wikipedia representations. It uses the All - stem configuration for CBOW and All - stop for Skip-gram and BERT. The table groups Post, Pre, and Both for each architecture, so the placement comparison holds the named suite of operations fixed within an architecture. The larger differences are therefore informative about where the treatment occurs, within this specific pipeline.
For CBOW, Pre scores above Post throughout the table. On the Airline test data the weighted F-scores are 71.28 for Post, 73.25 for Pre, and 73.00 for Both. For ISEAR, the cross-validation scores are 62.00 for Post, 65.33 for Pre, and 64.52 for Both. On Reddit, Both leads with 70.10, followed by Pre at 68.53 and Post at 67.13. The same choice to prepare the corpus thus helps in both classification protocols, while treating the downstream text too can change the ranking.
Skip-gram also has higher Pre scores than Post scores across the table. For Onion, the held-out weighted F-score is 75.07 for Post, 75.69 for Pre, and 75.48 for Both. For Airline, the Both setting reaches 73.58 against 72.19 for Pre and 71.85 for Post. For ISEAR, the cross-validation result goes from 62.08 in Post to 64.00 in Pre, and Both reaches 65.29. The comparison concerns the selected preprocessing recipe. Other combinations can produce different Skip-gram scores, which the separate ablation experiment shows.
BERT gives an especially clear placement result on SemEval, where Pre has a weighted F-score of 73.81 on the test split. The Both setting is between the two single-placement settings. Adding preprocessing to the classification dataset changes the score despite the use of an already preprocessed corpus, and in this run the added processing accompanies a lower result than Pre alone.
BERT preprocessing placement on SemEval, test weighted F-score
Processing the representation corpus alone gives the strongest result.
The numbers
| System or setting | weighted F-score |
|---|---|
| Classification data only | 70.25 |
| Representation corpus only (this paper) | 73.81 |
| Representation corpus and classification data | 72.41 |
For the BERT Airline comparison, Post records 92.35, Pre records 94.85, and Both records 93.00 on the test split. The IAC test scores follow the same order, with 74.69 for Post, 75.80 for Pre, and 75.19 for Both. The paper describes Pre as beating Post throughout the evaluation, but the BERT IMDB row is an exception in the table. There Post scores 94.58, Pre scores 94.18, and Both scores 94.63. The broader pattern supports taking corpus preparation seriously. Its precise implication depends on the dataset and on the classification text the learned vectors will encode.
The strongest representation differs on Reddit
The released-embedding comparison reports the authors’ selected CBOW, Skip-gram, and BERT scores alongside the baselines. BERT leads the comparison for eight datasets, with Reddit the exception. On IMDB, BERT achieves a weighted F-score of 94.18, CBOW reaches 91.10, and the strongest released entry in the table, GloVe, reaches 85.64. These are the entries in the embedding comparison. The direct placement study gives a higher IMDB BERT score when the treatment is applied to both sources of text.
On the Airline test split, the BERT entry reaches 94.85. The strongest released result in that column is SSWE at 78.29. The selected CBOW and Skip-gram results are 73.25 and 73.66, respectively. This makes the ordering informative in two ways. The authors’ BERT result leads the column, while the released sentiment-specific resource outperforms both of their static representation entries there. On SemEval, BERT scores 73.81, while GloVe reaches 70.29 and SSWE 69.27. The corresponding CBOW and Skip-gram entries are 62.19 and 61.74. The released baselines therefore remain competitive against some of the authors’ settings even where the BERT entry has the highest score.
Reddit has a different ordering. Skip-gram reaches 68.72, CBOW reaches 68.53, and BERT reaches 65.39 in the embedding comparison. GloVe has the strongest released entry there at 63.57. The chart uses this comparison rather than the placement experiment. In particular, the selected Skip-gram score in the chart and the Skip-gram Pre score in the placement comparison come from different preprocessing configurations.
Selected embeddings on Reddit sarcasm, test weighted F-score
Skip-gram leads the comparison, with CBOW ahead of BERT as well.
The numbers
| System or setting | weighted F-score |
|---|---|
| GloVe | 63.57 |
| BERT | 65.39 |
| CBOW | 68.53 |
| Skip-gram (this paper) | 68.72 |
For the emotion datasets, the BERT entries reach 60.73 on Alm, 69.33 on ISEAR, and 69.81 on SSEC under the cross-validation protocol. On Alm, EWE reaches 58.33 and GloVe reaches 56.21. Their scores exceed the selected CBOW and Skip-gram entries of 52.39 and 52.01. On ISEAR, EWE reaches 66.09, compared with 65.33 for the authors’ CBOW entry. On SSEC, the BERT result leads, and the CBOW and Skip-gram entries are closer to the strongest released results. This spread makes it possible to observe both the benefit of corpus preparation within an architecture and the choice of representation that matters when comparing across architectures.
Absolute performance and relative improvement answer different questions
The paper’s task-level figure compares absolute weighted F-scores with relative improvement from Basic to the strongest preprocessing setting. The absolute score answers how well the resulting classifier recognizes labels under that dataset’s evaluation protocol. The relative comparison concerns the benefit over Basic on the same dataset. A dataset can show favorable movement from its reference and still finish with a lower absolute score than another dataset.
The discussion describes sentiment and sarcasm as broadly comparable in absolute performance, with the multiclass emotion datasets generally scoring lower. The authors suggest that the length of the IMDB reviews may help explain strong performance on that dataset. Their prose calls IMDB the highest-scoring dataset overall, although the listed BERT comparison has a higher score on Airline, at 94.85, than the IMDB entry of 94.18. Review length remains a proposed explanation for strong performance, and the reported results do not establish a length effect.
The emotion datasets show the largest relative improvement in the authors’ figure. Their BERT Wikipedia rows illustrate why an evaluation needs both views. Alm goes from 57.81 with Basic to 60.73 in the strongest reported configuration for that row. ISEAR goes from 65.70 to 69.33, and SSEC goes from 65.39 to 69.81. Each pair refers to the same dataset’s cross-validation protocol. The authors take the task-level pattern as a sign that corpus preprocessing may be particularly helpful for multiclass emotion classification. The experiment links that observation to these emotion datasets, whose genre, size, and label balance also differ from those of the other tasks.
What the ablations show
Negation is the strongest individual treatment on News
The News experiments assess preprocessing in two directions. The authors add each individual factor to Basic to see what it achieves on its own. They also remove individual factors from the complete pipeline to see how the remaining combination behaves. Those comparisons answer separate questions. An operation can perform well as a single change and have a smaller contribution when several transformations are already present. Conversely, an operation whose individual result is modest can matter inside a sequence of treatments.
Negation handling leads the individual treatments for both CBOW and Skip-gram across the News evaluation. For CBOW on the IMDB test split, Basic has a weighted F-score of 83.99. The individually applied grammatical filter scores 85.66, punctuation scores 86.99, and negation reaches 88.98. The full combination gives 89.96, and the version omitting stopword removal gives 90.01. These results place the strong single operation in context. There is additional headroom from combining operations for this dataset, and the exact combination has consequences.
Selected News CBOW preprocessing settings on IMDB, test weighted F-score
Negation leads the individual treatments shown, and the combined setting that retains stopwords scores highest.
The numbers
| System or setting | weighted F-score |
|---|---|
| Basic | 83.99 |
| Grammatical filtering only | 85.66 |
| Punctuation only | 86.99 |
| Negation only | 88.98 |
| All factors | 89.96 |
| All factors except stopword removal (this paper) | 90.01 |
The advantage of negation on its own appears in the other task families too. With News Skip-gram on Onion, Basic gives 68.01 and negation gives 70.59 on the test split. The grammatical filter gives 69.81 and punctuation gives 70.00. For CBOW on ISEAR, the cross-validation score with Basic is 55.43, while negation scores 57.39 and grammatical filtering scores 57.04. The latter is often among the stronger individual treatments. Its exact rank shifts across the table, whereas negation is consistently at the top of the single-factor comparison.
There is a plausible connection between the operation and those scores. Replacing a negation cue and its neighbor with an antonym makes some affective constructions enter training as familiar lexical items. This changes the examples of the antonym and the contexts of nearby words. The experiment shows how the complete rule performs in an embedding and classification pipeline. It does not trace particular classification decisions to particular antonym substitutions. The pattern is compatible with the authors’ explanation that negation handling makes affective information easier to learn from the corpus.
Spellchecking, stopword removal, and stemming show smaller or mixed single-factor effects. With News CBOW on the SSEC cross-validation runs, Basic gives 51.76, spellchecking 52.14, and stemming 51.89. On Onion with the same representation architecture, the Basic test result is 68.23 and stopword removal yields 68.17. On IAC, Basic gives 65.74 and stopword removal gives 66.03. Those cases show why the authors assess the operations as concrete interventions on a dataset. A smaller vocabulary or shorter corpus is a measurable change to training material, while improvement in weighted F-score is a separate outcome.
The full treatment can lose to a simpler configuration
News CBOW gives a clear example of interactions among operations. On Onion, negation alone reaches 71.12 and the full combination gives 70.90. On Reddit, the corresponding test scores are 54.15 and 53.71. For SSEC, the cross-validation scores are 54.15 with the individually applied negation rule’s Reddit result kept separate from SSEC’s own 54.15? The relevant SSEC comparison is 54.15 for negation and 53.71 for the full treatment only if those entries are read in the wrong column. In the SSEC column, the News CBOW weighted F-scores are 54.15 for negation and 53.71 for All.
The omission experiments can clarify how the combination behaves without identifying a unique mechanism. For News CBOW on Onion, omitting stopword removal yields 72.49, while omitting stemming yields 72.13. Both exceed the full combination and the individual negation setting. For News Skip-gram on Airline, All gives 64.91 on the test split, the version omitting stopword removal gives 67.00, and the version omitting stemming gives 67.39. Removing a factor can therefore be worthwhile even when adding that factor individually gave a small gain over Basic.
The comparison with the pipeline that omits negation points in the other direction. On News CBOW for IMDB, the score falls from 89.96 with All to 84.67 when negation handling is omitted. For IAC it goes from 67.23 to 66.02. These scores complement the individual-factor result. They show a contribution from negation in the presence of the other operations for those settings. Because each omission changes the text passed to subsequent operations, these are measurements of the whole pipeline with one change, including its downstream consequences.
Two configurations recur near the strongest News scores. For IMDB with Skip-gram, leaving out stopword removal gives 88.74 and leaving out stemming gives 88.42. For the same architecture on IAC, the recorded result without stemming is 69.08, compared with 68.57 when stopword removal is left out. The paper emphasizes the combination without stemming in its discussion of News. The table gives a dataset-level view in which leaving stopwords in is also frequently favorable.
The strongest omission depends on the representation
On Wikipedia, the authors report full and omission comparisons for all three architectures. For BERT, All - stop is the highest-scoring option in every dataset column of the ablation table. On the IMDB test split, Basic scores 90.11, All reaches 91.86, and All - stop reaches 94.18. For IAC the respective scores are 71.19, 73.66, and 75.80. For SSEC, the cross-validation results are 65.39, 67.49, and 69.81. This consistency within BERT is the clearest support for the authors’ overall conclusion that the larger preprocessing suite works best when it retains stopwords.
CBOW gives a more varied picture. On Wikipedia and IMDB, All - stop scores 91.10, while All - stem scores 88.76. On Alm the cross-validation scores in the same order are 52.39 and 50.28. For Onion, however, the test result without stemming reaches 75.69 against 74.50 without stopword removal. ISEAR also favors the omission of stemming, with 65.33 against 64.29. The paper selects All - stem for CBOW in the timing experiment, reflecting the strong showing of that combination across many columns. The individual columns still matter when interpreting a claim about the best configuration for a particular use.
The Wikipedia Skip-gram rows also change rank with the dataset. On SemEval, leaving out stopword removal gives 61.74, while leaving out stemming yields 60.28. The Airline test split favors keeping the original word forms, with 73.66 for All - stem versus 72.19 for All - stop. Reddit similarly scores 68.72 without stemming and 68.29 without stopword removal. On ISEAR, the full Skip-gram combination reaches 65.02, greater than either of those two omissions. That score appears in the comparison with released embeddings, while the placement experiment uses the recipe without stopword removal and lists its Pre value of 64.00 for ISEAR.
The corpus statistics help explain why stopword removal can have large consequences without establishing why it hurts particular scores. On News the individual stop setting retains a vocabulary of 150K compared with 155K under Basic, while corpus size is 75.6M against 123.2M. The change in occurrence count is much more visible than the change in the inventory of word forms. A learner can encounter many different surroundings for surviving words after so many tokens are removed. The performance tables measure the result of that intervention, while they leave the contribution of specific omitted words open.
The timing experiment isolates where changes enter
The placement study provides a control complementary to leaving out factors. Pre and Post use the same selected suite within each architecture. With Pre, the transformation changes the distribution of material used to learn the representation. With Post, it changes the words used to read out an existing representation through the classifier. For CBOW on SemEval, Pre scores 62.19 compared with 59.33 for Post on the test split. The Both value of 62.41 leads the row. For BERT on the same dataset, Pre’s lead is larger in the reported scores, and Both lies below Pre.
The results for Both indicate that compatibility and information retention are distinct considerations. Applying the same treatment to both sources can make the classifier’s input resemble the form of text used during representation learning. It also subjects the labeled examples to additional deletions or replacements. In the CBOW Reddit comparison, Both yields the highest score of the three placements. For BERT on Reddit, Pre’s 65.39 leads Both at 65.17 and Post at 63.38. This shows that agreement between the two preprocessing pipelines can have different implications across the learned representations used in the experiment.
The compatibility convention for stemming is part of the interpretation. The paper stems the classification data whenever stemming is needed to match the vocabulary. Accordingly, the labels Pre and Post describe where the selected preprocessing suite is applied, with downstream stemming allowed to support representation lookup. The experiments address that implemented pipeline. They show how to compare corpus preparation with downstream preparation while preserving a workable link between the text and the learned word forms.
Limitations
Limits the authors state
The authors explicitly leave a wider exploration of factor subsets for future work. The experiment includes single factors and combinations made by dropping one factor from the full treatment. These comparisons cover a substantial part of the question they ask, but they can only identify a strongest setting among the tested configurations. An untested pair of operations or a different collection of retained factors could change the outcome. The authors also prescribe a particular order for combined preprocessing. Their conclusions about the combinations refer to operations performed in that order.
They describe the comparison against released pretrained embeddings as a secondary aim. The primary evidence concerns the effect of changing preprocessing and its placement under the authors’ evaluation setup. The baseline comparison adds a practical point of reference for the learned representations. Because the released resources bring their own corpora and learning objectives, differences among their final scores have several potential sources.
The paper itself offers explanations for two broad patterns with appropriately tentative language. It suggests that longer movie reviews help account for IMDB’s strong performance, and it proposes that the greater relative gains on the emotion datasets may indicate greater benefit for multiclass tasks. The experiments do not independently vary review length or the number of labels while keeping the other properties of the data fixed. Those suggestions are interpretations of the comparisons across datasets.
Limits visible in the setup
The negation procedure covers immediate neighbors with available antonyms. A cue can govern a longer expression, and its next token can have a different role from the word whose meaning is being negated. A lexical antonym can also be stronger than the negated original or convey a different shade of feeling. In the paper’s example, replacing not happy with sad offers a usable mapping, while leaving distinctions between dissatisfaction, neutrality, and sadness outside the rule. Choosing across dictionary senses at random also leaves room for a sense that does not fit the sentence. The paper tests the downstream effect of the whole procedure and supplies neither a breakdown by kind of negation nor a measurement of the correctness of its individual replacements.
The frequency preference in spelling correction and antonym choice also limits the scope of an explanation based on those operations. Frequency can resolve competition among candidates in a uniform way. It is separate from the question of whether the replacement preserves the intent expressed in a particular example. That matters especially when the writing deliberately stretches a word or uses an unusual expression. The study’s varied genres are a way to see whether these procedures help in practice across the selected collections. The scores do not identify which specific kinds of expressive writing the transformations preserve or discard.
The difference between News and Wikipedia combines several changes. The corpora differ in size and source, and CBOW and Skip-gram also use different context-window and minimum-count settings across them. The authors associate the generally stronger Wikipedia results with the larger corpus. The setup identifies a difference between the training conditions as used, without isolating a size effect. Likewise, the run times describe training on the authors’ infrastructure. Although the corpus statistics document substantial reductions under certain filters, the paper does not give a measured timing comparison for each preprocessing condition.
The classification results are tied to the LSTM evaluation setup. The same type of classifier makes the studied word representations easier to compare, yet it leaves open how much the findings depend on that classifier and on the way contextual representations are passed to it. The paper gives the BERT architecture and says it follows the original settings. Details such as which contextual output is used for each position and how it is transferred into the classifier receive less description than the corpus operations. The discussion of punctuation likewise leaves the distinction between Basic punctuation cleanup and the separate punc factor underspecified in prose.
Weighted F-score captures a dataset-level outcome that accounts for differences in class support. A gain can arise because one or several well-represented classes are easier to recognize. The reported numbers do not show whether rare emotion classes benefited or whether errors shifted between particular labels. The results tables also give point scores without uncertainty intervals or per-setting dispersion. Small gaps in those tables establish a numerical ordering for the reported scores, while the evidence for that ordering persisting across repeated classifier splits or training variation is limited.
Finally, different evaluation groups use different protocols and distinct sources of labels. The emotion results come from stratified cross-validation, while the sentiment and sarcasm scores use held-out test splits. Sarcasm on Reddit is self-annotated, and the two labels in the headline collection are associated with different publishers. A classifier could partly exploit source-associated language in that headline setup. The experiment does not test performance on headlines whose source and sarcasm label vary independently. The cross-dataset view establishes breadth across the included evaluations, with the meaning of each score grounded in how that dataset was constructed and tested.
What came after
Affective and Contextual Embedding for Sarcasm Detection cites the study and focuses on the intersection of affective representations, context, and sarcasm. Its topic narrows the earlier comparison across sentiment, emotion, and sarcasm to a task where affective information may interact with the surrounding utterance. That is a visible continuity with the earlier paper’s placement experiment, which tests whether changing how representations are acquired improves a later sarcasm decision.
The citation and title establish that connection at the level of research focus. They do not establish that the later study reused the negation dictionary, adopted the setting that retains stopwords, or repeated the corpus-versus-classification comparison. In the earlier paper, sarcasm already gives reasons to take that distinction seriously. The Wikipedia placement table favors Pre for BERT on the headline, dialogue, and Reddit datasets, while the comparison of selected representations favors Skip-gram on Reddit. A later focus on affective and contextual embeddings for sarcasm takes up a specific part of a question that the preprocessing study examined across several tasks and genres.
Cite
Cite as Nastaran Babanejad, Ameeta Agrawal, Aijun An and Manos Papagelis. 2020. A Comprehensive Analysis of Preprocessing for Word Representation Learning in Affective Tasks. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.
@inproceedings{babanejad2020comprehensive,
title = {{A Comprehensive Analysis of Preprocessing for Word Representation Learning in Affective Tasks}},
author = {Nastaran Babanejad, Ameeta Agrawal, Aijun An and Manos Papagelis},
booktitle = {Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics},
year = {2020},
doi = {10.18653/v1/2020.acl-main.514},
url = {https://doi.org/10.18653/v1/2020.acl-main.514}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/babanejad-2020-comprehensive-analysis-preprocessing-word-representation/