Text classification improved through multigram models

Dou Shen, Jian-Tao Sun, Qiang Yang, Zheng Chen2006

TL;DR

This paper introduces "n-multigram models" for text classification, a novel approach that automatically discovers meaningful sequences of words (beyond simple n-grams) within documents. This representation leads to competitive or improved classification performance with significantly smaller model sizes compared to traditional n-gram models, and a combined approach further boosts accuracy.

What Problem Does This Paper Address?

Traditional text classification systems often rely on "bag-of-words" representations, which treat each word independently. This ignores the crucial contextual information and semantic relationships between words, leading to ambiguity and reduced accuracy. While some methods try to capture these relationships using phrases or external knowledge bases like WordNet, they often require significant manual effort or external resources that aren't always available. N-gram models, which consider sequences of words, offer an improvement but can lead to very large models and data sparsity issues. This paper aims to bridge this gap by proposing a method that automatically learns flexible, variable-length semantic sequences from text, improving representation quality while managing model complexity.

Methods

The core innovation is the n-multigram model. Unlike fixed-length n-grams, n-multigrams can capture sequences of words of varying lengths (up to 'n'). These sequences are discovered automatically using an Expectation-Maximization (EM) algorithm combined with Viterbi training. The EM algorithm iteratively refines the probabilities of these sequences and their segmentation within documents.

The paper proposes two main classification algorithms:

  1. N-multigram model classifier (CM): This classifier directly uses the learned n-multigram models to represent documents and assign categories.
  2. Combined n-gram and n-multigram model classifier (CM+N): This approach first uses the n-multigram models to segment documents into sequences. Then, n-gram models are trained on these sequences to represent the documents. This leverages the strengths of both approaches: n-multigrams for discovering semantic units and n-grams for capturing sequential dependencies within those units.

The paper also explores variations of the n-multigram classifier by introducing "bonus functions" that can either influence the segmentation process to favor longer sequences or directly boost the likelihood of longer sequences during probability calculation.

Datasets

The experiments were conducted on the RCV1 dataset, a large benchmark collection for text classification research. To manage computational resources, the authors selected 10% of documents from the top 10 categories, resulting in 47,042 documents. A 3-fold cross-validation procedure was used for evaluation.

Key Insights and Ideas

  • Variable-length sequences are powerful: Automatically discovering sequences of words of varying lengths (n-multigrams) captures richer semantic information than fixed-length n-grams.
  • Model size reduction: N-multigram models achieve comparable or better performance than n-gram models with significantly smaller model sizes, addressing a key challenge in text classification.
  • Synergy of n-grams and n-multigrams: Combining the strengths of both approaches (CM+N classifier) leads to substantial improvements in classification accuracy, suggesting that different levels of linguistic structure are complementary.
  • Automatic discovery is key: The ability to automatically learn these semantic sequences without relying on external resources like WordNet makes the approach more generalizable and practical.

Key Results

  • The n-multigram model classifier (CM) achieved similar or better classification performance compared to n-gram models (CNG, CNW) on the RCV1 dataset, while having a much smaller model size. For example, the model size for CM was only 30% of CNw when n=2.
  • The combined classifier (CM+N) significantly improved performance, boosting micro-F1 from 89.5% to 92.6% and macro-F1 from 87.2% to 91.1% compared to the best single-model classifiers.
  • These improvements were found to be "very highly significant" using a t-test.
  • Parameter tuning experiments showed that the occurrence threshold ($c_0$) of 5 and a probability threshold ($p_0$) of $10^{-7}$ generally yielded optimal results. The number of iterations (K) for the EM algorithm had a rapid convergence, with performance stabilizing after a few iterations.

Limitations and Future Work

  • Parameter Sensitivity: While parameters like $c_0$ and $p_0$ were tuned, their optimal values might vary across different datasets.
  • Bonus Function Impact: The paper notes that while bonus functions can influence performance, the specific choice of function and when it's applied (during segmentation vs. after) can have varying effects, with one bonus function (b2) generally outperforming another (b1).
  • Future Work: The authors suggest testing their proposed document representation approaches with other classification algorithms like Support Vector Machines (SVM) and K-Nearest Neighbors (KNN) to verify their adaptability and generalizability across different datasets.

Summary updated

Abstract

Classification algorithms and document representation approaches are two key elements for a successful document classification system. In the past, much work has been conducted to find better ways to represent documents. However, most of the attempts rely on certain extra resources such as WordNet, or they face the problem of extremely high dimension. In this paper, we propose a new document representation approach based on n-multigram language models. This approach can automatically discover the hidden semantic sequences in the documents under each category. Based on n-multigram language models and n-gram language models, we put forward two text classification algorithms. The experiments on RCV1 show that our proposed algorithm based on n-multigram models alone can achieve the similar or even better classification performance compared with the classifier based on n-gram models but the model size of our algorithm is much smaller than that of the latter. Another proposed algorithm based on the combination of n-multigram models and n-gram models improves the micro-F1 and macro-F1 values from 89.5% to 92.6% and 87.2% to 91.1% respectively. All these observations support the validity of our proposed document representation approach.
BibTeX
@misc{shen2006text,
  author = {Dou Shen and Jian-Tao Sun and Qiang Yang and Zheng Chen},
  title = {{Text classification improved through multigram models}},
  year = {2006},
  doi = {10.1145/1183614.1183710},
}
Figure