---
title: "Text Classification Algorithms — paper by Kowsari et al. (2019)"
description: "A survey of text classification algorithms explains how to represent documents, reduce feature size, train classifiers, and evaluate their predictions."
canonical: "https://research.elamur.ai/free/en/papers/kowsari-2019-text-classification-algorithms-survey/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/kowsari-2019-text-classification-algorithms-survey/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/) / Text Classification Algorithms: A Survey

# Text Classification Algorithms: A Survey

Paper · 2019 · Kamran Kowsari, Kiana Jafari Meimandi, Mojtaba Heidarysafa et al.

**Authors:** [Kamran Kowsari](https://md.research.elamur.ai/free/en/authors/kamran-kowsari/), [Kiana Jafari Meimandi](https://md.research.elamur.ai/free/en/authors/kiana-jafari-meimandi/), [Mojtaba Heidarysafa](https://md.research.elamur.ai/free/en/authors/mojtaba-heidarysafa/), Sanjana Mendu, Laura Barnes and [Donald E. Brown](https://md.research.elamur.ai/free/en/authors/donald-e-brown/) · **Year:** 2019 · **Venue:** Information · **Licence:** [CC BY 4.0 (arXiv)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **68** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/kowsari-2019-text-classification-algorithms-survey/cited-by/) · Information · [licence](https://creativecommons.org/licenses/by/4.0/)

- [PDF](https://arxiv.org/pdf/1904.08067)
- [DOI 10.3390/info10040150](https://doi.org/10.3390/info10040150)
- [arXiv 1904.08067](https://arxiv.org/abs/1904.08067)

## Summary

A classifier that sorts messages, reviews, or reports starts with a decision about what to keep from the text. Word counts can reveal the subject of a document, while the order of its words may be essential to deciding what it says about that subject. A representation that makes one task straightforward can leave another classifier without the evidence it needs. This survey of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/) follows those decisions from raw text to evaluation. It separates the work into feature extraction, optional dimensionality reduction, classification, and measurement, and explains how choices at each stage affect the others.

The authors begin with cleaning and segmentation, then compare counting words with learning numerical representations of them. [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/) discounts terms found throughout a collection, while [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) can give similar representations to words that occur in similar surroundings. The survey distinguishes a fixed vector for a word from a representation that changes with each occurrence. It also examines ways of making large feature spaces easier to work with. Some preserve variation or distances, some use category labels to find separating directions, and others learn to reconstruct an input from a shorter code.

The classification methods range from simple rules based on category prototypes or nearby examples to ensembles and neural networks that process local phrases, sequences, or whole documents. The authors compare their assumptions, computational demands, and suitability for different kinds of evidence. A category prototype is cheap to consult once learned, for example, while a nearest-neighbor method retains individual examples and has to find the relevant ones at prediction time. The survey also discusses techniques that organize decisions around a category hierarchy or learn from a mixture of labeled and unlabeled documents.

The paper's conclusions come primarily from comparisons across existing research. A method's suitability depends on the text, the available training data, and the decision the system must make. The authors use short messages to illustrate why an embedding learned from a different kind of text can be a poor fit. They also explain why overall accuracy can conceal errors in uncommon categories and why even studies using the same collection can be hard to compare when their training and test partitions differ. The resulting account connects algorithm choice to practical questions such as how much evidence a system needs, when it must produce predictions, and which errors matter in its application.

## Deep dive: Text Classification Algorithms: A Survey

A survey of text classification algorithms explains how to represent documents, reduce feature size, train classifiers, and evaluate their predictions. · about 45 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What receives a label

Text classification turns a passage into a decision drawn from a defined set of categories. The passage can be an entire document, a paragraph, a sentence, or an expression within a sentence. Each level gives the classifier a different amount of evidence. A document can supply context for a term that is ambiguous in isolation. A sentence or smaller expression, on the other hand, is a more precise target when the desired label applies to just part of what the document says. The survey treats the unit of classification as part of the task definition. It determines both what the system sees and what an example in the evaluation represents.

In the paper's main supervised setting, examples pair passages with category labels. A classifier learns from those pairs and makes a decision about passages whose labels are withheld from it. The paper also covers situations in which this pairing is incomplete. A whole group can have a label even though the items within it have none, or a collection can include many documents that have never been labeled at all. These cases differ in what is unknown. A label on a group constrains what can be true of its members. An unlabeled document supplies evidence about the distribution of text, while its category remains to be inferred.

Raw text makes the learning problem difficult because the evidence comes in variable-length sequences. Two passages can use different words for similar content. A pair of passages using the same words can convey different meanings through their order. A pronoun may depend on something named in an earlier sentence. Meanwhile, a collection can contain so many distinct terms that a separate feature for each creates a large computational burden. The authors organize these difficulties around the information that the classifier can use and the cost of making that information available.

#### How earlier work framed the task

The survey traces an important strand of document categorization to [information retrieval](https://md.research.elamur.ai/free/en/topics/information-retrieval/). Retrieval asks which items in a collection meet an information need. It can use similarity between a query and a document and return a ranking. The paper describes how related operations became ways of assigning categories. The Rocchio technique began with relevance feedback for search and was adapted to compare documents against category prototypes. Weighted terms likewise served a retrieval purpose before becoming common classification features. A category decision and a retrieval ranking can therefore draw on related representations while producing different outputs.

Earlier work also established several ways of turning those representations into decisions. Naïve Bayes uses observed words as evidence for categories whose prevalence and vocabulary it estimates from examples. Logistic regression directly estimates a probability for a category given the input features. Nearest-neighbor classification compares a new passage with labeled passages. Support vector machines learn separating boundaries, decision trees organize decisions as successive feature tests, and ensembles combine the decisions of several fitted classifiers. The paper situates these approaches within prior surveys, including [Sebastiani's work on automated text categorization](https://md.research.elamur.ai/free/en/papers/sebastiani-2002-machine-learning-automated-text-categorization/).

As the review moves towards sequence-aware approaches, the issue becomes how to carry structure from text into the decision. Conditional random fields offer a way to assign related labels across an observed sequence. Neural methods provide several other mechanisms. A convolution can detect a local pattern wherever it appears. A recurrent network carries a state along the text. A hierarchical attention network can organize evidence around words and the sentences containing them. These designs reflect different answers to a practical question. If the decisive evidence lies in a phrase, in a relationship across positions, or in one sentence among many, where should the computation look for it?

#### Why applications make different demands

The authors use several applications to explain why text classification covers more than assigning topics to documents. In information filtering, the input arrives as a stream and the task is to admit or reject items according to some criterion, such as relevance or spam. In content-based recommendation, the classification evidence can come from an item's description and a user's past feedback or stated interests. The target in that case concerns the relationship between the item and the user. An item's topic alone may leave that question open.

In [sentiment analysis](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/), the task is to identify opinion or subjectivity, including whether an expressed opinion is positive or negative. Topic words can identify what a passage is about while contributing little to the direction of the opinion. The authors discuss evidence such as opinion phrases, negation, and [part-of-speech tags](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/), which identify grammatical categories of words. They also mention [dependency relations](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/), which describe grammatical links between words. These features can matter when a decision depends on how an opinion is expressed.

Other examples give classification a supporting role in a larger process. In [document summarization](https://md.research.elamur.ai/free/en/concepts/text-summarization/), a classification decision can help identify material worth carrying forward. In medical coding, the goal is to assign categories from a defined inventory to information expressed in clinical text, where ambiguous terms and typing errors can occur. The survey also describes document categorization for legal retrieval, classifying social media for business and social research, and examining whether accident narratives contain information about their causes. Each application changes the meaning of a correct prediction, even when it uses one of the same learning techniques.

### The method, step by step

#### From passages to decisions

The survey describes a common workflow and reviews alternative techniques at each stage. The first stage defines and prepares the units that will receive labels. Feature extraction then expresses each unit as numerical input. Some approaches give the classifier a single vector for the passage. Others give it a sequence of vectors and preserve the sequence positions. Dimensionality reduction can make a large representation more manageable. A fitted classifier then predicts labels for test examples, and those predictions are compared with the reference labels. The authors identify their public Text Classification repository as the home of accompanying code and results.

The survey’s text classification workflow The steps in order.

The paper denotes the collection as follows.

```
D = {X₁, X₂, …, Xₙ}
```

Here `D` is the collection, each `Xᵢ` is a document or other text unit, and `n` denotes the number of units. The ellipsis stands for the intervening examples. Each example in the supervised setup has a label from a finite set. The contents of a unit can be described as sentences, words, and letters. This gives a feature extractor several possible levels at which to make distinctions. The units that receive labels can stay fixed while the units from which features are built change.

#### Cleaning changes the evidence

[Tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) splits a stream into units such as words or symbols. That may sound like a bookkeeping step, but a token is what a counting method counts and what a word-based method looks up. Treat an abbreviation as a single unit and it can get its own coordinate or vector. Expand it into several words and the downstream representation can share some of its evidence with passages that spell the expression out. The same choice changes which sequences of adjacent tokens a feature extractor can find.

The paper considers removing common words, lowercasing, handling informal text, and omitting punctuation or special characters. Each operation deliberately groups or discards distinctions. Lowercasing pulls together occurrences that differ in case. The authors point out that it can also collapse an abbreviation for a country into an ordinary pronoun. Dropping common words reduces the vocabulary a classifier has to handle. Whether a common word is dispensable depends on the target, as the paper's discussion of negation in sentiment classification illustrates. Similarly, punctuation can be treated as noise for one representation and can carry information a reader uses to understand another passage.

Spelling correction is optional. The survey mentions approaches that use context and approaches that use a data structure for matching candidate spellings together with an edit distance. The purpose is to let variant spellings contribute evidence to the same or related features. Slang and abbreviation conversion has a similar motivation. The operation must decide what a form means before it can normalize it. The need for that decision is especially visible in short informal texts, where there may be little surrounding material to disambiguate a word.

[Stemming](https://md.research.elamur.ai/free/en/concepts/stemming/) folds related forms toward a shared stem, illustrated by the relationship between *studying* and *study*. [Lemmatization](https://md.research.elamur.ai/free/en/concepts/lemmatization/) seeks the base form of a word. Both can pool evidence that would otherwise be spread across forms. The point of this pooling is easier to see in a count vector than in the original prose. If forms have separate coordinates, a classifier must learn their usefulness separately or rely on another mechanism to connect them. A shared feature builds the connection into the representation.

#### Counting words and preserving local order

In a bag-of-words representation, the corpus vocabulary supplies the vector coordinates. For a particular document, the coordinate for a word can contain its count, an indication that it occurred, or a transformed count. A document normally activates only part of the vocabulary, so its vector can be sparse, with many empty coordinates. The length of that vector is determined by the vocabulary used by the system. The amount of evidence it contains depends on the tokens in the document.

A bag of individual words preserves their multiplicity and discards their arrangement. The paper illustrates this with a short question and a statement that use the same words in a different order. A classifier downstream of those counts receives identical inputs. The problem arises before any training takes place. Even a classifier with more expressive decision rules would need some additional input to tell the passages apart.

An [n-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/) records a sequence of a chosen length. The survey illustrates features built from consecutive pairs and triples. A pair can record which word follows another, and a triple can distinguish some additional arrangements. The same document can be represented with features for individual words and for short sequences. The longer features record more detail about local order, while the classifier can still use the simpler features in documents where the exact sequence never occurs. The survey also covers syntactic n-grams, in which a path through a grammatical tree supplies the sequence. A path can join words whose relationship matters even when other words intervene in the sentence.

Term frequency measures occurrences within a document. Inverse document frequency uses the wider collection to adjust their weight.

```
W(d,t) = TF(d,t) × log(N / df(t))
```

Here `d` is a document, `t` is a term, and `W(d,t)` is the resulting feature weight. `TF(d,t)` is the term frequency in the document. `N` is the number of documents in the corpus, `df(t)` counts documents containing the term, and `log` takes the logarithm of their ratio. The term's repetition and its spread across documents enter separately. A term can be common within a particular document and comparatively rare across the collection. That gives it a different weight from a term with the same local count that appears in many more documents.

TF-IDF changes the importance of a coordinate and keeps the vocabulary's distinctions intact. The survey's example of several words for aircraft illustrates the consequence. A coordinate for one of those words does not directly contribute evidence to a coordinate for another. Word-level n-grams can record phrases around each term, but those phrases still use the same distinct vocabulary items. The paper turns to embeddings to explain how numerical proximity can carry information about shared usage.

#### Learning a representation of words and their contexts

A word embedding assigns a vector of real-valued coordinates to a word or phrase. The vector can be learned from usage in a corpus, independently of labels on the downstream classification task. [Word2Vec](https://md.research.elamur.ai/free/en/papers/mikolov-2013-efficient-estimation-word-representations-vector/) gives the survey two complementary training problems. Continuous bag-of-words uses nearby words as input to predict the target word. Skip-gram takes the target word as input and trains against words around it. The first has a collection of context words on the input side. The second has a collection of context predictions on the output side. In either case, the relationships learned while predicting words become available through the vectors.

```
θ̂ = arg max over θ [∏(w ∈ T) ∏(c ∈ C(w)) p(c | w; θ)]
```

Here `θ̂` is the fitted parameter choice, `arg max` selects parameter values that maximize the expression, and `θ` denotes the parameters being fitted. `T` is the training text supplying target occurrences `w`. `C(w)` denotes the context words for an occurrence of `w`, each represented by `c`. The symbol `∏` means to multiply the factors across the indicated occurrences. The factor `p(c | w; θ)` is the probability assigned to a context word given the target and the parameters. The paper describes the context size in the continuous bag-of-words discussion as commonly set to 4–5 words. That setting concerns the input for word prediction.

[GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) also learns from surrounding words. Its treatment in the survey emphasizes ratios derived from corpus co-occurrences. When a context word helps distinguish the uses of two target words, its relative probability is informative about their difference. Where it occurs in both contexts at similar rates, it supplies little evidence for distinguishing them.

```
f(wᵢ − wⱼ, w̃ₖ) = Pᵢₖ / Pⱼₖ
```

Here `wᵢ` and `wⱼ` are target word vectors, with `i` and `j` identifying the two words. `w̃ₖ` is the context vector for word `k`. `Pᵢₖ` and `Pⱼₖ` give the probability that word `k` occurs in the context of target `i` and target `j`, respectively. The function `f` expresses the desired relationship between the vector difference, the context vector, and that probability ratio. The paper points to pretrained GloVe vectors as a concrete way of obtaining these features without learning them afresh from a labeled classification corpus.

FastText, discussed through [work on subword information](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/), changes what makes up a word's input representation. It gives features to character n-grams, including sequences that touch the beginning or end of a word. Parts of two words can thus share parameters. This is relevant to [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/), the structure and forms of words, because different forms can contain some of the same pieces. Boundary markers distinguish a sequence that belongs at a word edge from the same letters inside another word.

```
s(w,c) = ∑(g ∈ G(w)) zᵍᵀv꜀
```

Here `s(w,c)` is the score for word `w` and context word `c`. `G(w)` is the set of n-gram features belonging to `w`, `g` indexes a feature, and `zᵍ` denotes its vector. `v꜀` is the context vector. The superscript `ᵀ` denotes transposition so that `zᵍᵀv꜀` is an inner product. The sum adds the contributions of the character features. The design allows pieces to share evidence across word forms while the resulting score still depends on the context vector it is compared with.

The contextualized representation in the survey, ELMo, addresses a different question. A word can mean different things in different sentences even when it has precisely the same spelling. A fixed vocabulary lookup supplies the same word vector in both sentences. A contextualized representation uses the surrounding sequence to supply a vector for the occurrence. The underlying [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) learns to predict tokens using sequence context. In the bidirectional setup, one direction conditions on preceding tokens and the other on following tokens.

```
p(t₁, t₂, …, tₙ) = ∏(k = 1 to N) p(tₖ | t₁, …, tₖ₋₁)
```

Here `t₁` through `tₙ` denote the tokens in a sequence, `N` is its length, and `k` indexes a position. The lower-case subscript `ₙ` on the last token refers to that same length. `p` denotes a probability, the bar means conditioning on the listed tokens, and `∏` multiplies one probability per position. This is the forward factorization of the probability of the sequence.

```
p(t₁, t₂, …, tₙ) = ∏(k = 1 to N) p(tₖ | tₖ₊₁, …, tₙ)
```

The tokens `t₁` through `tₙ`, length `N`, position `k`, probability `p`, and product sign have the same roles here. The context after the bar now consists of the tokens that follow position `k`. Training uses the log probabilities of the observed tokens in both directions. Each direction supplies hidden representations, the intermediate vectors computed as the network processes its input.

```
hₖ,ⱼᴸᴹ = [h⃗ₖ,ⱼᴸᴹ, h⃖ₖ,ⱼᴸᴹ]
```

Here `hₖ,ⱼᴸᴹ` is the combined language-network representation of token position `k` at layer `j`. The right and left arrows identify the forward and backward vectors. The brackets concatenate them, keeping the information computed in both directions.

```
ELMoₖ(task) = γ(task) × ∑(j = 0 to L) sⱼ(task) hₖ,ⱼᴸᴹ
```

Here `ELMoₖ(task)` is the embedding at position `k` for the downstream task. `L` identifies the top layer in the sum, `j` indexes layers starting with the input representation, and `hₖ,ⱼᴸᴹ` is the representation at that position and layer. The `sⱼ(task)` are normalized layer weights obtained with softmax, and `γ(task)` is a learned scalar that scales the combination. The classifier can therefore use a task-specific mixture of contextual information from different layers. The paper separately discusses the problem of building coherent representations across sentence boundaries. Contextual information is useful at the scope at which the representation has access to it.

#### Making a large feature space smaller

A wide term matrix can be expensive to store and process. The survey treats dimensionality reduction as optional because several goals could justify it, and those goals favor different transformations. A method might keep the directions in which documents vary most, keep directions that separate categories, approximate the original feature values, or preserve enough information about nearby points to draw a visualization. Every reduced representation makes a choice about which relationships survive.

Principal component analysis, or PCA, builds new coordinates as linear combinations of the old ones. It looks for uncorrelated directions that capture large amounts of variation in the observations. With rows for documents and columns for features, the projection gives each document a new value computed from its original feature values.

```
var(Xa) = aᵀSa
```

Here `X` is the observation matrix, `a` is a vector of coefficients for the direction, and `Xa` is the column of projected observations. `var` denotes variance, `S` is the sample covariance matrix of the features, and `ᵀ` denotes transposition. The direction is constrained to unit length when maximizing the variance, so simply rescaling the coefficients cannot improve the objective. Retaining a subset of directions compresses the data. The paper also discusses kernel PCA as a way to extend the procedure to nonlinear structure.

Independent component analysis starts with the idea that the observed variables are mixtures of underlying independent components. It asks which components and mixing coefficients could account for the observations.

```
X = As
```

Here `X` is the vector of observed mixtures, `A` is the matrix of mixing weights, and `s` is the vector of latent components. Each row of `A` specifies how the components contribute to one observed variable. The aim of recovering statistically independent components differs from the PCA goal of obtaining uncorrelated directions of high variance. The distinction matters because a linear decomposition on its own says little about what criterion selected the directions.

Linear discriminant analysis uses the known labels to look for separating directions. The mean of each class describes its location. The variation of documents around that mean contributes to within-class scatter, and the displacement of class means from the overall mean contributes to between-class scatter. The criterion favors a projection in which category centers are relatively far apart compared with the spread of examples within categories.

```
Sᵦ = ∑(i = 1 to c) Nᵢ(μᵢ − μ)(μᵢ − μ)ᵀ
```

Here `Sᵦ` is the between-class scatter matrix, `c` is the number of classes, and `i` indexes them. `Nᵢ` is the number of examples in class `i`. The vectors `μᵢ` and `μ` are the class mean and overall mean, respectively. The transpose `ᵀ` makes the product of the difference vector and its transpose an outer product. The sum weights the contribution of each class by its size.

```
J(W) = det(WᵀSᵦW) / det(WᵀS𝓌W)
```

Here `J` scores the projection matrix `W`, whose columns are projection directions. `Sᵦ` is between-class scatter, `S𝓌` is the sum of the within-class scatter matrices, `ᵀ` denotes transposition, and `det` gives the determinant. The numerator and denominator measure the corresponding scatter after projection. This illustrates why labels can change the reduced representation. A direction with substantial variation may serve little purpose for classification if the categories vary along it in much the same way.

Non-negative matrix factorization, or NMF, represents a matrix of non-negative features with two smaller non-negative matrices. Its reduced document coordinates are the coefficients used to reconstruct the original observations from shared components.

```
V ≈ WH
```

Here `V` is the non-negative input matrix, `W` contains component vectors, and `H` contains their coefficients. The approximation symbol means that the matrix product reconstructs the original values with some error. In the paper's column convention, each column of `H` gives the reduced coordinates of the corresponding column of `V`. The inner dimension controls the size of the reduced space and the capacity available to reconstruct the input.

```
F = ∑ᵢ ∑ⱼ (Vᵢⱼ − (WH)ᵢⱼ)²
```

Here `F` is the squared reconstruction objective, `i` indexes the rows and `j` the columns of the original matrix `V`, and `(WH)ᵢⱼ` is the entry reconstructed by the two factors. The sums add the squared residuals. The survey also gives an objective based on Kullback–Leibler divergence, a way to measure disagreement between distributions or their non-negative representations. Its iterative updates adjust the factors using the relation between observed and reconstructed entries. In the document workflow, the corpus is cleaned, local and global term weights form a matrix, and the learned transformation is used to express test documents in the same reduced space. Query similarity is an optional additional operation in the retrieval example.

Random projection pursues a different goal. It seeks a smaller space in which distances remain useful without learning directions from the main axes of variation. The paper uses the Johnson–Lindenstrauss lemma to explain why such a mapping is possible for a finite set of points. It gives the following distance bound, with the unit factors made explicit where the printed notation is inconsistent.

```
(1 − ε) ‖u − v‖² ≤ ‖f(u) − f(v)‖² ≤ (1 + ε) ‖u − v‖²
```

Here `u` and `v` are original points, `f` maps them to the reduced space, `‖·‖` denotes Euclidean length, and `ε` controls the permitted distortion in squared distance. The inequalities bound the new squared distance both below and above. This is a geometric statement. A useful measure of document similarity must already be reflected in the original space for the distance guarantee to carry over to the classifier's task.

The related random kitchen sinks technique approximates a shift-invariant kernel, a similarity function of the difference between two inputs. The survey describes sampling directions from a distribution and evaluating trigonometric features of the projected inputs. The inner product of the resulting feature vectors approximates the kernel. The approach trades the cost of direct kernel computation for explicit coordinates and an approximation whose quality depends on the sampled features.

An autoencoder learns a compact code by trying to reproduce its input at its output. The intermediate layer in the survey's basic setup has fewer units than the input. This bottleneck makes the network decide what information to carry through. In the bag-of-words example, the encoder adds representations associated with the occurrences in the input, then applies a nonlinear transformation.

```
a(x) = c + ∑(i = 1 to |x|) W[:,xᵢ]
```

Here `x` is the input document as token indices, `|x|` counts those tokens, and `xᵢ` is the index of the token at position `i`. `W[:,xᵢ]` selects its column from the weight matrix `W`. The vector `c` is a bias, and `a(x)` is the vector before activation. Repeated occurrences contribute repeatedly to the sum.

```
ϕ(x) = h(a(x))
```

Here `ϕ(x)` is the code for input `x`, `a(x)` is the encoder's pre-activation vector, and `h` acts on each coordinate. A decoder uses the code to reconstruct an input of the original size. The paper also discusses convolutional and recurrent autoencoders. A convolutional encoder works with feature maps, and its decoder reconstructs from them. A recurrent autoencoder works with an ordered sequence and uses a recurrent state to support sequence prediction. The difference is important when reconstruction is meant to preserve arrangement as well as overall content.

The survey discusses t-distributed stochastic neighbor embedding, or t-SNE, chiefly as a visualization method. Its account starts from stochastic neighbor embedding. In the original space, it converts distances from a point into a distribution over other points. It then seeks low-dimensional positions whose neighbor relationships approximate the original ones.

```
pⱼ₍ᵢ₎ = exp(−‖xᵢ − xⱼ‖² / (2σᵢ²)) / ∑(k ≠ i) exp(−‖xᵢ − xₖ‖² / (2σᵢ²))
```

Here `pⱼ₍ᵢ₎` denotes the conditional neighbor probability of point `j` given point `i`. The vectors `xᵢ`, `xⱼ`, and `xₖ` are positions in the original space, with `k` running over all points other than `i` in the denominator. The norm gives Euclidean distance, `σᵢ` determines the width of the neighborhood around `i`, and `exp` is the exponential function. Each numerator represents relative closeness and the denominator normalizes the weights.

```
C = ∑ᵢ ∑ⱼ pᵢⱼ log(pᵢⱼ / qᵢⱼ)
```

Here `C` is the cost in the survey's symmetric neighbor-embedding formulation. The joint probabilities `pᵢⱼ` and `qᵢⱼ` describe pair relationships in the original and mapped spaces, respectively. The indices `i` and `j` identify points, and `log` takes the logarithm of the ratio. Adjusting the mapped positions reduces the discrepancy between the two sets of relationships. A visualization can reveal how selected points lie near one another under this objective. Its axes and apparent groups do not themselves give measures of classification quality.

#### Learning from prototypes, boundaries, and neighbors

Rocchio reduces each category to a representative document vector. Training is the act of averaging the vectors of labeled examples in that category. At prediction time, a test document is compared with those representatives.

```
μ(c) = (1 / |D꜀|) ∑(d ∈ D꜀) v_d
```

Here `μ(c)` is the centroid of class `c`, `D꜀` is the set of training documents in that class, `|D꜀|` counts them, and `v_d` is the feature vector for a document `d`. The sum is componentwise, so a coordinate in the prototype reflects its average weight in the training examples.

```
c* = arg min over c ‖μ(c) − v_d‖
```

Here `c*` is the predicted class, `arg min` selects the class with the smallest distance, `μ(c)` is that class's centroid, `v_d` now represents the test document, and `‖·‖` denotes Euclidean length. The paper also describes centroid normalization. Its printed normalized dot-product rule is inconsistent with choosing maximum similarity, so the distance rule is the unambiguous formulation of the decision described in the text.

The nearest-neighbor method uses individual examples during prediction. It first finds the training documents most similar to the incoming document. It then pools their support for candidate categories and selects the category supported most strongly. A single category can receive contributions from several neighbors. This allows examples from different parts of a category to influence a prediction according to where the new example lies in feature space.

```
S(x,Cⱼ) = ∑(dᵢ ∈ Nₖ(x)) sim(x,dᵢ) I(dᵢ belongs to Cⱼ)
```

Here `S(x,Cⱼ)` is the score for category `Cⱼ` on query document `x`. The set `Nₖ(x)` contains its `k` nearest training documents, and `dᵢ` denotes one of them. `sim` is the similarity measure and `I` is an indicator that contributes one when the stated class membership holds and zero otherwise. The weighted variant changes the importance of terms inside the similarity calculation. The examples on which the rule relies can therefore change even when both the corpus and the number of neighbors are held fixed.

Logistic regression learns a score from the input features. For a binary category decision it maps that score to the probability of a positive label. The paper's binary likelihood and its neural-network discussion give the probability-preserving sigmoid below.

```
σ(η) = 1 / (1 + exp(−η))
```

Here `η` is the input score, formed in logistic regression from the feature values, fitted coefficients, and intercept. `σ(η)` is the sigmoid of that score, and `exp` denotes exponentiation with base `e`. The coefficients are fitted by maximizing the likelihood of the observed labels. In the binary likelihood, a positive example contributes the probability assigned to the positive class and a negative example contributes its complement. With several competing categories, the multinomial version assigns each category a score and normalizes exponentials of all category scores. The result is a distribution over the available class choices.

Naïve Bayes estimates a prior probability for each class and the likelihood of document evidence within that class. The classifier uses Bayes' rule to combine the two.

```
P(c | d) = P(d | c) P(c) / P(d)
```

Here `c` is a category and `d` is the observed document. `P(c | d)` is the posterior probability of the category, `P(d | c)` is the likelihood of the document in that category, `P(c)` is its prior probability, and `P(d)` is the probability of the document under the full distribution. For choosing among categories for a fixed document, the denominator is common to every choice. In the multinomial version, word counts determine how many times a term's conditional probability contributes to the likelihood.

```
P(w | c) = (1 + ∑(d ∈ D꜀) n(w,d)) / (K + ∑(w′ ∈ V) ∑(d ∈ D꜀) n(w′,d))
```

Here `w` is the word being scored, `c` is its category, and `D꜀` contains that category's training documents. `n(w,d)` counts occurrences of `w` in document `d`. The dummy term `w′` ranges over the vocabulary `V`, whose size is `K`. Adding one in the numerator and vocabulary size in the denominator implements the smoothing described by the formula. A term absent from a category's training documents can thus still have a probability. The paper also describes a class-normalized variant aimed at unbalanced data, and relates its score to a comparison between category centroids.

A support vector machine uses a separating boundary in its feature space. The survey covers linear and nonlinear variants, including ways to construct multiclass decisions from pairwise classifiers or to learn competing class scores jointly. Text features may be weighted terms or sequences of words. A string kernel supplies similarity directly from patterns in strings. In the spectrum variant, the feature map records occurrences of strings of a selected length, and the kernel measures overlap through the corresponding feature vectors.

```
K(x,x′) = ⟨Φ(x), Φ(x′)⟩
```

Here `K` is the kernel, `x` and `x′` are the two input strings, `Φ` maps each string to its pattern features, and the angle brackets denote an inner product. The patterns shared by the strings contribute to their similarity. The authors also describe designs that stack support vector classifiers down a category hierarchy. The upper decision then constrains which of the more specific categories is considered below it.

#### Learning from groups, feature tests, and sequences

Multiple-instance learning changes the unit of supervision. The learner gets labels on bags of items. A positive bag contains at least one positive instance, and a negative bag contains only negative instances. A classifier sees the group labels and has to infer which members could account for them.

```
Yᵢ = max over j ∈ Iᵢ of yⱼ
```

Here `Iᵢ` is the set of indices in bag `i`, `yⱼ` is the latent binary label of member `j`, and `Yᵢ` is the observed bag label. With positive labels ranked above negative ones, the maximum implements the positive-bag rule. A negative bag constrains every member, while a positive bag says only that some member meets the criterion. This explains why correct bag-level decisions and correct identification of individual evidence are distinct outcomes.

A decision tree learns a succession of tests on features. At any node, the examples have a class distribution. The algorithm considers partitioning the examples according to a feature and prefers a partition that makes the resulting groups purer. The survey describes this using information gain, the reduction in entropy, or class uncertainty.

```
IG(A) = H(E) − ∑(i = 1 to K) (|Eᵢ| / |E|) H(Eᵢ)
```

Here `IG(A)` is information gain for a test on attribute `A`. `E` is the group of examples at the node, its `K` branches yield subsets `Eᵢ`, and the vertical bars give the sizes of those sets. `H` is the entropy of class proportions in a set. The sum gives the expected entropy after splitting, weighted by the share of examples sent down each branch. Choosing a large gain places a feature test near the top when it divides the available training examples into relatively clear groups.

A random forest combines votes from randomized trees. The paper describes its margin as the share of trees voting for the reference class less the highest share for any competing class. A wide margin means that the reference class has a substantial lead over the closest competitor. A forest and a single tree also differ operationally. A single tree follows one path for an input. A forest must collect predictions from the trees used in its vote. The survey therefore discusses the number of trees as a consideration at prediction time as well as during fitting.

Bagging and boosting also combine classifiers. In bagging, each classifier is trained on its own bootstrap sample drawn from the training set. They vote on the result, with the paper allowing arbitrary resolution of ties. Boosting changes which examples carry weight at successive rounds. A round gives more influence to examples the preceding classifier handled poorly, and the final classifiers receive weights in the vote.

```
αₜ = (1 / 2) ln((1 − εₜ) / εₜ)
```

Here `αₜ` is the vote weight for the classifier at round `t`, `εₜ` is its weighted error, and `ln` is the natural logarithm. The formula ties the vote weight to how well the classifier did under that round's example weights.

```
Hꜰ(x) = sign(∑ₜ αₜ hₜ(x))
```

Here `Hꜰ(x)` is the final binary classifier's decision for input `x`. The round classifier is `hₜ`, its signed decision is `hₜ(x)`, and its weight is `αₜ`. The sum combines rounds indexed by `t`, and `sign` turns the signed total into the final binary decision. The ensemble shifts the dependence of any prediction from one fitted classifier to a collection of weighted decisions.

A linear-chain conditional random field assigns a probability to a sequence of labels given the sequence of observations. This is useful when nearby label decisions depend on each other. The paper connects such graphical techniques to keyword extraction and summarization. A transition and the observed text can jointly contribute evidence to the score of a label sequence.

```
P(Y | X) = (1 / Z(X)) ∏(t = 1 to T) ψ(t, yₜ₋₁, yₜ, X)
```

Here `Y` is a candidate label sequence and `X` is the observed input sequence. `T` is the number of positions, `t` indexes them, and `yₜ₋₁` and `yₜ` are neighboring labels. The potential `ψ` is a non-negative compatibility score. The normalization `Z(X)` sums the unnormalized sequence weights for the fixed observations, making `P(Y | X)` a probability. The product combines evidence across positions. The survey expresses each potential as the exponential of a weighted feature score, allowing several properties of the observations and the labels to influence the same transition.

#### Learning representations inside the classifier

A fully connected deep network transforms an input vector through successive hidden layers. The input may be TF-IDF or some other numerical text representation. Nonlinear activations let the layers express relationships that would collapse into a linear function if every step were linear. The parameters are fitted by propagating prediction error backward through the network. The output supplies class scores, which can be converted to probabilities.

```
σ(z)ⱼ = exp(zⱼ) / ∑(k = 1 to K) exp(zₖ)
```

Here `z` is the vector of class scores, `zⱼ` is the score of class `j`, `K` is the number of classes, and `k` indexes the scores in the denominator. The function `exp` exponentiates each score, and `σ(z)ⱼ` is the resulting softmax probability for class `j`. Because every class shares the denominator, a change to one score can change the normalized probabilities of the others.

A recurrent network reads its input in sequence and uses a state that changes with each token. The recurrence gives earlier inputs a route to influence later computations through the state. The authors also discuss why ordinary recurrence can be hard to train across many positions. Repeated steps in back-propagation can make the gradient too weak or too large. A state can in principle carry information over a long span while the training procedure still struggles to learn what to preserve.

```
xₜ = F(xₜ₋₁, uₜ, θ)
```

Here `t` is the sequence position, `xₜ` is the current state, `xₜ₋₁` is the previous state, `uₜ` is the current input, and `θ` denotes the fitted parameters of the update function `F`. This recurrence is also what distinguishes a sequence of word vectors from a document vector fed into a fully connected layer. The network uses the order in which inputs arrive to compute a new state at each position.

Long short-term memory, or LSTM, provides a cell state and gates that regulate the contribution of old and new information. The input gate determines what to incorporate from a candidate memory value. The forget gate determines what to retain from the previous memory. The output gate regulates how the stored information becomes visible in the recurrent output.

```
Cₜ = iₜ ⊙ C̃ₜ + fₜ ⊙ Cₜ₋₁
```

Here `Cₜ` and `Cₜ₋₁` denote the current and previous cell states. `C̃ₜ` is the candidate content at position `t`, `iₜ` is the input gate, and `fₜ` is the forget gate. The symbol `⊙` means coordinatewise multiplication. The new state can carry part of the previous memory and part of the candidate content at the same time. Gate values depend on the input and previous hidden state through learned weights and biases.

```
hₜ = oₜ ⊙ tanh(Cₜ)
```

Here `hₜ` is the visible hidden state at position `t`, `oₜ` is the output gate, `Cₜ` is the cell state, `tanh` is the hyperbolic tangent applied coordinatewise, and `⊙` again denotes coordinatewise multiplication. The distinction between memory and visible output gives the cell a way to retain information for later use even when the current output gives that information little weight.

The gated recurrent unit, or GRU, uses an update gate and a reset gate and keeps its history in the recurrent state. The survey connects it to [Cho and colleagues' recurrent encoder–decoder work](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/) and discusses recurrent sequence processing in connection with [sequence-to-sequence learning](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/).

```
hₜ = zₜ ⊙ hₜ₋₁ + (1 − zₜ) ⊙ tanh(Wₕxₜ + Uₕ(rₜ ⊙ hₜ₋₁) + bₕ)
```

Here `hₜ` and `hₜ₋₁` are the current and previous states, `zₜ` is the update gate, `rₜ` is the reset gate, and `xₜ` is the input at position `t`. `Wₕ` and `Uₕ` are weight matrices for the input and prior-state contributions, and `bₕ` is a bias vector. The function `tanh` transforms the candidate state and `⊙` multiplies coordinates. In the survey's convention, `zₜ` weights the retained state and its complement weights the candidate. The reset gate acts inside the computation of that candidate.

A convolutional classifier applies filters across local windows in a token sequence. A filter can respond to a pattern wherever it appears. The resulting feature map records the response at different positions, and max pooling retains the highest response in a pooling window. The final layers use pooled features to score the categories. In the paper's discussion of [convolution and word order](https://md.research.elamur.ai/free/en/papers/johnson-2015-effective-use-word-order-text/), the dimensionality of the input is a practical issue. Many vocabulary coordinates can make the initial text representation much wider than an input with a small set of channels.

The survey also covers deep belief networks, assembled from restricted Boltzmann machines. A restricted Boltzmann machine uses visible units for observations and hidden units for learned structure. Its energy expression describes the contribution of biases and visible-to-hidden interactions.

```
E(v,h) = −aᵀv − bᵀh − vᵀWh
```

Here `E` is the energy of the configuration, `v` and `h` are visible and hidden vectors, and `a` and `b` are their respective bias vectors. `W` contains the weights joining visible and hidden units, and `ᵀ` denotes transposition. The paper names contrastive divergence as a training technique for these units. The representation learned from observations can ultimately support a decision about a class.

#### Combining architectures and using incomplete labels

The paper describes two different uses of hierarchy. In a hierarchical attention network, the hierarchy is inside the input. The first stage encodes words and gives their contributions different weights when forming a sentence representation. A higher stage uses sentence representations and weights their contributions to the document. In Hierarchical Deep Learning for Text, or HDLTex, the hierarchy concerns the output categories. A parent-level classifier supplies a general category and sends the document to a classifier specializing in the corresponding children. One design structures how the evidence is read and the other structures which decisions are made.

The paper gives examples of architectures and training settings for HDLTex. Its fully connected version has 8 hidden layers with 1024 units in each. The recurrent description names both long short-term memory and gated recurrent units and specifies 100 cells for the GRU setup. The reported batch size is 128 and the learning parameter is 0.001. The authors give dropout settings of 0.5 for the fully connected implementation and 0.25 for the convolutional and recurrent implementations. Dropout is a training operation that suppresses selected activations. These figures describe the setup for the prior hierarchical approach as presented by the survey. Its evaluation expression combines performance at levels of the hierarchy and includes category counts, reflecting the dependence of fine-grained decisions on the category structure.

Random Multimodel Deep Learning, or RMDL, combines fitted neural classifiers by majority vote. The survey describes randomly choosing depths and widths across fully connected, convolutional, and recurrent architectures. Its illustrative ensemble contains 9 classifiers, with 3 drawn from each architecture family. Each classifier first converts its own output scores to a predicted label.

```
ŷᵢⱼ = arg max over k [softmax(sᵢⱼ)]ₖ
```

Here `ŷᵢⱼ` is the label predicted for example `i` by classifier `j`, `sᵢⱼ` is its vector of class scores, and `softmax` normalizes those scores as above. The subscript `k` selects the score for class `k`, and `arg max` returns the class index of the largest probability.

```
M(yᵢ₁, …, yᵢₙ) = ⌊1/2 + ((∑(j = 1 to n) yᵢⱼ) − 1/2) / n⌋
```

Here `M` is the binary ensemble decision, `i` identifies the example, and `j` ranges over the `n` classifiers. Each `yᵢⱼ` is a prediction encoded as zero or one, the sum counts votes for the positive class, and the floor brackets round down to the next integer at or below their contents. An exact tie in this expression goes to zero. The rationale for varying architectures and optimizers is that their errors and successes may differ. The vote itself supplies no information about how often these differences will help on a given corpus.

The RMDL discussion names Adam and RMSProp as the 2 optimizers used in its evaluation. It also reviews stochastic gradient descent, which updates parameters using a gradient computed from part of the training data, and adaptive approaches that adjust updates using accumulated gradient information. The survey describes [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) in terms of estimates from gradients and squared gradients, and [AdaDelta](https://md.research.elamur.ai/free/en/papers/zeiler-2012-adadelta-adaptive-learning-rate-method/) in terms of decaying averages. These are choices about how to fit the parameters. The architecture still determines the computations whose parameters the optimizer can change.

Some combined architectures merge computations within one classifier. A recurrent convolutional classifier uses recurrence to capture context and convolution to form a representation for classification. The C-LSTM architecture described in the paper first produces phrase-level features with convolution and then processes their sequence with an LSTM. These designs put the sequence and local-pattern operations in different orders. Their combination affects what evidence each operation can use when it runs.

In semisupervised classification, the survey starts from the setting in which only a portion of the training collection has labels. One reviewed strategy clusters the collection and uses labels already present in a cluster as evidence about unlabeled members. A cluster with conflicting labels or no labels makes the assignment underdetermined. The paper then reviews alternatives that use low-density separation or estimate hidden labels with expectation maximization. It also describes translated features for cross-language classification and a method that gives review categories graded memberships in semisupervised sentiment classification. These techniques share a source of additional evidence, unlabeled text, while making different assumptions about how that evidence is related to classes.

### Experiments and results

#### What the comparisons cover

The paper brings together several kinds of evidence. Its discussion compares published classification systems by architecture, feature representation, corpus, evaluation measure, contribution, and stated drawbacks. Elsewhere it works through examples of fitted representations, training settings, and prediction rules. These accounts have different evidential force. A reported setup describes the conditions under which an approach was configured. A numerical score would describe how well it performed under a specific test procedure. The survey does not present a unified experiment with a shared dataset, baseline suite, held-out split, and score for each classifier.

The corpora identified in the paper serve several roles. Reuters news illustrates a difficulty in evaluation design. Researchers can use the same named collection and obtain different results because they assign different documents to training and testing. The Federal Railroad Administration corpus supplies an illustration of a t-SNE projection of Word2Vec vectors. It is an example of visualizing a feature space. The Wikipedia and Gigaword material discussed under GloVe and the Wikipedia material discussed under FastText are sources for learning word representations. They serve a different role from a test collection with labels for a downstream task.

The paper identifies support vector machines as common baselines for work proposing new classification techniques, and word-level naïve Bayes appears as another baseline in its account. The comparisons across classifier families help explain what those baselines test. A weighted-term classifier can show how far individual term evidence goes. A sequence-aware system has access to other evidence as well, so attributing an observed improvement would require knowing whether both the representation and the classifier changed. The survey's qualitative example of GloVe and TF-IDF on short messages makes this especially clear. The authors describe TF-IDF as a stronger fit in that example and relate the issue to the mismatch between short informal text and embedding training material. They give no paired score or split for that comparison in their discussion.

#### A numerical comparison of input settings

The survey names a GloVe configuration with 50 coordinates per word and a vocabulary size of 400,000, trained using Wikipedia 2014 and Gigaword 5. It also names GloVe configurations with 100, 200, and 300 coordinates and describes larger training collections, including Twitter content. Its FastText example uses 300 coordinates per word and covers 294 languages in the pretrained vectors it describes, using Wikipedia text. These are figures for representation dimensions, vocabulary, and language coverage. The chart compares dimensions, where lower means a shorter vector for each word.

Pretrained GloVe vector length across Wikipedia 2014 and Gigaword 5 and larger corpora including Twitter The most compact configuration uses fewer coordinates to represent each word.

**The numbers**

| System or setting | dimensions per word |
| --- | --- |
| GloVe on Wikipedia 2014 and Gigaword 5 (this paper) | 50 |
| GloVe larger vector setting | 100 |
| GloVe larger vector setting | 200 |
| GloVe larger vector setting | 300 |

The chart marks compactness alone. The paper describes differences in the training material as well as the dimension, so the settings do not isolate the effect of making a vector longer. It gives no corresponding held-out classification scores that would show whether the more compact vector preserves the evidence needed by a particular classifier. The numerical comparison is useful for understanding input size and the range of configurations the survey discusses. The evidence about predictive quality comes from the qualitative and literature-based comparisons elsewhere in the paper.

#### What the evaluation measures count

The survey explains performance measures through the confusion matrix. First choose a class whose presence counts as a positive decision. True positives are correctly accepted examples, and false positives are accepted examples that lack the class. False negatives are missed examples that have it, and true negatives are correctly rejected examples. These counts can describe a binary task or a chosen category treated as positive against the remaining categories.

```
accuracy = (TP + TN) / (TP + TN + FP + FN)
```

Here `TP` is the true-positive count, `TN` the true-negative count, `FP` the false-positive count, and `FN` the false-negative count. The numerator counts correct decisions and the denominator counts all decisions. The paper's concern about class imbalance follows from that denominator. When there are many negative examples, correct rejections can dominate the aggregate measure even if the classifier misses a substantial share of actual positives.

```
precision = TP / (TP + FP)
```

Here `TP` counts correct positive predictions and `FP` counts incorrect positive predictions. Precision describes the proportion of positive predictions that can be trusted according to the reference labels. It answers a different question from the one asked by recall.

```
recall = TP / (TP + FN)
```

Here `TP` counts positives the classifier identifies and `FN` counts positives it misses. Recall, also called sensitivity or true positive rate, describes coverage of the reference positives. Specificity addresses the corresponding question about reference negatives.

```
specificity = TN / (TN + FP)
```

Here `TN` counts correctly rejected negatives and `FP` counts negatives incorrectly called positive. The denominators of specificity and recall refer to the known membership of examples. The denominator of precision refers to the classifier's own decisions. That difference is important in a filtering application where the person reviewing returned items experiences false positives directly, while missed material may only become visible when the collection is checked against reference labels.

```
Fᵦ = (1 + β²) × (precision × recall) / (β² × precision + recall)
```

Here `Fᵦ` combines precision and recall, and `β` determines their relative weight. The survey highlights `β = 1`, which gives them equal weight and produces the familiar binary form below.

```
F₁ = 2TP / (2TP + FP + FN)
```

Here `F₁` is the equally weighted F score, `TP` is the true-positive count, `FP` is the false-positive count, and `FN` is the false-negative count. The expression evaluates detection through positive decisions and misses. The Matthews correlation coefficient uses all the confusion counts.

```
MCC = (TP × TN − FP × FN) / √((TP + FP)(TP + FN)(TN + FP)(TN + FN))
```

Here `MCC` is the Matthews correlation coefficient and `TP`, `TN`, `FP`, and `FN` refer to the four confusion counts. The products in the numerator oppose agreement and disagreement, and the square root in the denominator normalizes by combinations of actual and predicted totals. The authors note that classifiers can rank differently under MCC and the F score because the measures use different evidence.

In multiclass or multilabel settings, macro-averaging computes a measure for each category and then gives those category results equal weight. Micro-averaging adds confusion counts across classes before computing the measure. A rare category can have the same influence on the macro average as a common one. In the micro average it contributes according to the decisions it supplies. Two reported values described only as an F score can therefore refer to different evaluations even if both use the same underlying formula.

The receiver operating characteristic, or ROC curve, traces how the true positive rate and the false positive rate change as the decision threshold varies. The false positive rate divides `FP` by the total number of actual negatives, `FP + TN`. Area under that curve, or AUC, summarizes the ranking across thresholds. The paper expresses the binary quantity as a probability.

```
AUC = P(X₁ > X₀)
```

Here `X₁` is the score of an example drawn from the positive class, `X₀` is the score of an example drawn from the negative class, and `P` denotes probability. The inequality tests whether the positive example ranks higher. This is a way to evaluate a scoring rule across possible decisions. Selecting one operating threshold for a particular application still leaves the separate question of how many false positives and false negatives that decision produces.

### What the ablations show

The survey presents no controlled ablation of a single classification pipeline, and instead offers comparisons of feature representations and their costs, a qualitative short-message example about corpus and vocabulary fit, visualizations of learned embeddings, and an explanation of how class balance, test partitions, and averaging rules can change the conclusions drawn from separate evaluations.

### Limitations

#### Limits identified by the authors

The authors see recurring problems in the representations. Counts and weights can become expensive when the vocabulary is large, and term coordinates treat related words separately. Fixed pretrained vectors have difficulties when the target text contains abbreviations and other forms absent from the source corpus, and a fixed vector gives multiple uses of a word the same starting representation. Contextualized embeddings address variation in use, but the survey also shows how processing sentences separately can lose information that spans sentences. In its example, the first sentence introduces a person and later sentences refer to her with a pronoun. Another expression refers back to a day mentioned earlier. Those links are part of what a document-level decision may need to recover.

Dimensionality reduction has its own costs. The authors identify the computation required for PCA, the need for labels and a chosen component count in linear discriminant analysis, and the amount of data an autoencoder may require. They describe random projection as computationally cheaper than PCA and question its suitability for small datasets. They chiefly discuss t-SNE as a visualization tool. These observations highlight how different the criteria can be. A representation may be convenient to inspect, economical to store, or well suited to separating classes. Those properties have to be established for the particular reduction and purpose.

The survey also identifies drawbacks in the prediction stage. Nearest-neighbor methods require access to training examples and a meaningful similarity measure. A decision tree can change sharply after a small change in training data and can overfit, which motivates the discussion of validation and pruning. A forest can make prediction more costly as more trees are included. Boosting and bagging bring additional computation and can make individual decisions harder to interpret. The authors also describe expensive training for conditional random fields, difficulties with unseen vocabulary, and the data and training demands of deep neural approaches. In applications such as health, they emphasize [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/) because users may want to understand which evidence led to a decision.

#### Limits visible in the survey's evidence

The comparisons can identify mechanisms and tradeoffs, but they leave the size of most effects unresolved. A short-message example can make corpus mismatch plausible without showing how much of a score difference came from missing words, normalization of slang, or the choice of classifier. A visualization can show which vectors appear near one another in a projection without measuring how well a classifier uses those vectors. Similarly, the details given for a hierarchical classifier describe how it was organized and trained, while the hierarchy's contribution would require comparison with a suitable flat classifier under matched conditions. Readers can use the descriptions to formulate such comparisons. The survey does not supply their outcomes.

Some displayed equations also require care. The standalone sigmoid in the logistic regression discussion has signs inconsistent with the probability expression used in the likelihood and with the later neural-network formula. The micro-averaging display reuses the macro-averaging label, although the surrounding prose correctly explains that it pools confusion counts first. In the conditional random field discussion, the normalized expression has a partition term that a later display drops. These inconsistencies matter if a formula is used as an implementation specification. The surrounding text or an earlier equation resolves several of them, including the distinction between pooling decisions and averaging category measures.

The paper's comparison of feature representations and classifier families is broad, while the criteria for deciding among them depend on the application. Its preference for reporting more than accuracy follows directly from how the confusion counts are combined. Broader claims about computational speed, interpretability, or suitability for small corpora are observations from the surveyed techniques and settings. The paper supplies no shared timing protocol, uniform measure of interpretability, or learning curves that would put those properties on a common scale. This also limits what the comparison can establish for a particular corpus with a different vocabulary, distribution of categories, or cost of errors.

### What came after

#### Building datasets around particular languages and tasks

Several later works that cite the survey address a choice the survey places before feature extraction, namely which text units to collect and what they should be classified for. L3CubeMahaSent makes tweets in Marathi the material for a sentiment dataset. This brings a language and a text genre together with a target about expressed sentiment. It connects to the survey's discussion of short informal texts, where vocabulary coverage and normalization can matter because each input supplies relatively little context. The identifiable contribution is the dataset for that task. [L3CubeMahaSent](https://md.research.elamur.ai/free/en/papers/kulkarni-2021-l3cubemahasent-marathi-tweet-based-sentiment/)

The Amharic news dataset places the focus on news categorization. Its contribution is a classification dataset defined by the language and genre of its documents. This is a different starting point from the Marathi tweet collection. The survey's pipeline explains why that distinction matters before any comparison of algorithms. Changing genre and language changes which distinctions the features must express, while changing the target categories changes which distinctions will count as evidence. [An Amharic News Text classification Dataset](https://md.research.elamur.ai/free/en/papers/azime-2021-amharic-news-text-classification-dataset/)

The NADI shared-task submission applies machine learning and [Transformer-based approaches](https://md.research.elamur.ai/free/en/concepts/transformer/) to Arabic dialect identification. Dialect is the prediction target, so the relationship between language variation and the feature representation is especially direct. This work connects to the survey's account of choosing a classifier and its input features for a defined text collection. The description identifies the task and the families of approaches used for the submission. [Arabic dialect identification for NADI 2022](https://md.research.elamur.ai/free/en/papers/alshenaifi-2022-arabic-dialect-identification-machine-learning/)

#### Changing the training evidence or the label interface

Work on Arabic text classification by Refai and colleagues tackles the available training data through augmentation. It uses Transformers and [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/) measures in a method aimed at improving classification through additional examples. The connection to the survey lies upstream of the final decision rule. The survey gives attention to how a classifier's training material and representation can fit the eventual task. Augmentation intervenes in the material the learning procedure receives. The title identifies similarity measurement as part of that intervention. [Data augmentation for Arabic text classification](https://md.research.elamur.ai/free/en/papers/refai-2022-data-augmentation-using-transformers-similarity/)

Knowledgeable Prompt-tuning changes how a text classification task expresses its labels. A prompt establishes a form in which the system can respond, and the verbalizer links that response to a class. This work incorporates knowledge into the verbalizer itself. The survey's discussion of supervised classification typically begins with a defined set of category values and asks how the input should be represented. Prompt-based classification makes the wording that represents the outputs an additional design choice. The later paper addresses that choice on the output side of the task. [Knowledgeable Prompt-tuning](https://md.research.elamur.ai/free/en/papers/hu-2022-knowledgeable-prompt-tuning-incorporating-knowledge/)

An ensemble approach for disease prediction returns to another theme in the survey, the combination of classification decisions. The later work places ensemble classification within a multilayered language framework for disease prediction. The survey supplies the general distinction between training a single decision procedure and pooling decisions from multiple ones. The later work applies ensemble classification in a specific predictive setting. The title identifies the combination and the application while leaving the exact voting or aggregation procedure unspecified. [An ensemble classification approach for disease prediction](https://md.research.elamur.ai/free/en/papers/hamdi-2025-ensemble-classification-approach-multi-layered/)

#### Applying classification to new kinds of evidence

Work on detecting inappropriate erotic content applies machine learning to a screening decision defined by the content of a text. It fits the survey's discussion of information filtering, in which a system needs to decide whether incoming material satisfies a criterion. The task adds a concrete category definition to that general problem. The survey's distinction between false positives and false negatives describes two separate ways in which such a screening decision can fail. The later work's stated scope is the use of machine learning techniques for detection in text. [Detection of inappropriate erotic content in text](https://md.research.elamur.ai/free/en/papers/barrientos-2020-machine-learning-inappropriate-erotic-text/)

The study of Shakespeare's plays uses data science and machine learning for continuous analysis. Its subject is an extended body of literary text. The survey's distinction between whole-document and smaller passage units helps explain why the granularity of analysis matters for such a task. A single decision about an entire play and an analysis that follows the text as it proceeds can capture different information. The later study identifies continuous analysis of the plays as its aim. [Continuous analysis of Shakespeare's plays](https://md.research.elamur.ai/free/en/papers/swisher-2023-data-science-machine-learning-approach/)

PsyCoMark addresses psycholinguistic conspiracy markers through both extraction and detection. Extraction asks where the relevant evidence occurs, while detection asks whether the target is present. This pairing gives a concrete application to the survey's treatment of different text scopes. A system can be asked for an overall decision or for the smaller expressions that support a decision, and each requires reference judgments at the corresponding level. The shared-task work explicitly addresses both activities. [PsyCoMark](https://md.research.elamur.ai/free/en/papers/peng-2026-zhangpeng-semeval-2026-task-10/)

## Cite

Cite as Kamran Kowsari, Kiana Jafari Meimandi, Mojtaba Heidarysafa, Sanjana Mendu, Laura Barnes and Donald E. Brown. 2019. Text Classification Algorithms: A Survey. Information.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.3390/info10040150](https://doi.org/10.3390/info10040150) · [arXiv 1904.08067](https://arxiv.org/abs/1904.08067)

```bibtex
@inproceedings{kowsari2019text,
  title = {{Text Classification Algorithms: A Survey}},
  author = {Kamran Kowsari, Kiana Jafari Meimandi, Mojtaba Heidarysafa, Sanjana Mendu, Laura Barnes and Donald E. Brown},
  booktitle = {Information},
  year = {2019},
  doi = {10.3390/info10040150},
  eprint = {1904.08067},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.3390/info10040150}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
