Abstract
Traditional text categorization methods, such as Bag-of-Words (BoW) and $n$-grams, often fail to capture the structural relationships between words and suffer from high dimensionality. This paper proposes a structural approach by representing documents as "graphs-of-words." By applying frequent subgraph mining (gSpan) and $k$-core decomposition, the authors extract discriminative features that are robust to word order variations. Experimental results on benchmark datasets like R8 and Amazon show that this method outperforms $n$-gram baselines in accuracy while reducing the feature space by 50–70%.
Introduction
For decades, Natural Language Processing (NLP) has relied on the Bag-of-Words model, which treats documents as unordered collections of terms. While $n$-grams introduce local context, they are sensitive to phrasing variations (e.g., "news article" vs. "article about news") and cannot capture long-distance dependencies. Furthermore, the feature space for $n$-grams grows exponentially with the corpus size, leading to computational inefficiencies.
François Rousseau and colleagues address these limitations by treating text categorization as a graph classification problem. Their approach models documents as graphs where nodes are unique words and edges represent co-occurrences, allowing for the extraction of structural "DNA" through graph mining.
Methodology
The proposed pipeline consists of three primary stages: graph construction, subgraph mining, and dimensionality reduction.
Graph-of-Words Construction
Documents are transformed into undirected graphs where each unique word is a node. An edge is created between two nodes if the corresponding words appear together within a sliding window of size $w$. The authors determined that a window size of 4 provides an optimal balance between capturing context and maintaining graph sparsity.
Frequent Subgraph Mining and Reduction
The gSpan algorithm is employed to identify subgraphs that appear frequently across the dataset. These subgraphs function as flexible, long-distance $n$-grams. To manage computational complexity, the authors introduce $k$-core decomposition. By pruning each graph to its "main core"—the densest subgraph where every node has at least $k$ neighbors—they focus on the most discriminative terms. These mined features are then used to train a Linear Support Vector Machine (SVM).
Experimental Results
The framework was evaluated on four standard benchmarks: WebKB, R8, LingSpam, and Amazon product reviews.
Accuracy and Dimensionality
The gSpan + SVM approach achieved statistically significant improvements over $n$-gram baselines. For instance, on the R8 news dataset, accuracy increased from 0.947 to 0.955. Crucially, the Main Core (MC) reduction technique allowed for a 50% to 70% reduction in the number of unique features with negligible impact on performance.
Efficiency and the Elbow Method
The authors utilized an "elbow method" to automatically select the optimal support threshold for subgraph mining. As shown in the experimental plots, there is a sharp decline in the number of features as the support threshold increases, while accuracy remains relatively stable until a certain point. By mining only the main cores, feature extraction time was reduced from hours to seconds in some instances.
Discussion and Conclusion
The "graph-of-words" approach provides a robust alternative to linear text models. By capturing structural relationships, the model becomes invariant to word inversions and better at identifying key thematic clusters. While graph kernels were found to be less scalable for large-scale text, the combination of subgraph mining and $k$-core reduction offers a computationally feasible path forward. Future work may explore directed edges to capture syntactic nuances and scaling the method to web-scale corpora.
Summary updated