[Paper Review] N-gram-Based Low-Dimensional Representation for Document Classification
This paper proposes a bag-of-semantic-concepts model that uses averaged word vector representations of n-grams to create low-dimensional, semantically rich document representations. By clustering these n-gram vectors via K-means, the method reduces feature count by up to 344× while outperforming LSA and LDA and matching BOW performance with far fewer features on sentiment classification tasks.
The bag-of-words (BOW) model is the common approach for classifying documents, where words are used as feature for training a classifier. This generally involves a huge number of features. Some techniques, such as Latent Semantic Analysis (LSA) or Latent Dirichlet Allocation (LDA), have been designed to summarize documents in a lower dimension with the least semantic information loss. Some semantic information is nevertheless always lost, since only words are considered. Instead, we aim at using information coming from n-grams to overcome this limitation, while remaining in a low-dimension space. Many approaches, such as the Skip-gram model, provide good word vector representations very quickly. We propose to average these representations to obtain representations of n-grams. All n-grams are thus embedded in a same semantic space. A K-means clustering can then group them into semantic concepts. The number of features is therefore dramatically reduced and documents can be represented as bag of semantic concepts. We show that this model outperforms LSA and LDA on a sentiment classification task, and yields similar results than a traditional BOW-model with far less features.
Motivation & Objective
- To address the high-dimensional feature space and limited semantic expressiveness of traditional bag-of-words (BOW) models in document classification.
- To overcome the limitations of LSA and LDA by incorporating n-gram semantics while maintaining low-dimensional representation.
- To develop a computationally efficient, scalable method for document representation that supports unseen n-grams.
- To improve sentiment classification performance using low-dimensional semantic concepts derived from n-grams.
Proposed method
- Pre-trained word vectors (e.g., Skip-gram) are used to represent individual words in a dense vector space.
- N-gram representations are generated by element-wise averaging of the word vectors composing each n-gram.
- K-means clustering is applied to all n-gram vectors to group them into K semantic concepts, forming a low-dimensional semantic space.
- Documents are represented as a bag of these K semantic concepts, where each feature indicates presence/absence of n-grams from a concept cluster.
- The model leverages the compositional properties of word vectors to enable inference for unseen n-grams by averaging their constituent word vectors and assigning them to the nearest cluster centroid.
- The entire pipeline is highly parallelizable, enabling fast computation using standard CPU hardware.
Experimental results
Research questions
- RQ1Can n-gram-based representations improve document classification performance compared to traditional BOW, LSA, and LDA models?
- RQ2Can low-dimensional semantic concepts derived from n-grams maintain or exceed the performance of high-dimensional BOW models with significantly fewer features?
- RQ3How efficiently can n-gram-based semantic representations be computed, especially at scale?
- RQ4Can the model generalize to unseen n-grams not present in the training data?
Key findings
- The proposed model achieved 88.58% accuracy on the Maas et al. sentiment dataset, matching BOW performance with approximately 678 times fewer features.
- On the IMDB dataset, the model reached 88.58% accuracy with about 344 times fewer features than BOW, outperforming LSA and LDA.
- Computation time for the full model (1+2+3-grams, K=300) was approximately 2,360 seconds (~39 minutes) on a single CPU core, significantly faster than LDA (6 hours for 100 topics) and competitive with LSA (540 seconds for 300D).
- The model successfully assigns semantic concepts to unseen n-grams by averaging their word vectors and projecting them to the nearest cluster centroid, enabling robust generalization.
- K-means clustering of n-gram vectors captured meaningful semantic relationships, as evidenced by clusters containing antonymous phrases such as 'not good' and 'good' being grouped into distinct but semantically coherent clusters.
- The method demonstrated strong performance on binary sentiment classification tasks, showing that n-gram-level semantics can be effectively captured and leveraged in low-dimensional spaces.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.