Hierarchical vs. flat n-gram-based text categorization: can we do better?

Jelena Graovac1, Jovana Kovačević1, 2 and Gordana Pavlović-Lažetić1

  1. Faculty of Mathematics, University of Belgrade
    Studentski trg 16, 11000 Belgrade, Serbia
  2. School of Informatics and Computing, Indiana University
    Bloomington, Indiana, USA


Hierarchical text categorization (HTC) refers to assigning a text document to one or more most suitable categories from a hierarchical category space. In this paper we present two HTC techniques based on kNN and SVM machine learning techniques for categorization process and byte n-gram based document representation. They are fully language independent and do not require any text preprocessing steps, or any prior information about document content or language. The effectiveness of the presented techniques and their language independence are demonstrated in experiments performed on five tree-structured benchmark category hierarchies that differ in many aspects: Reuters-Hier1, Reuters-Hier2, 15NGHier and 20NGHier in English and TanCorpHier in Chinese. The results obtained are compared with the corresponding flat categorization techniques applied to leaf level categories of the considered hierarchies. While kNN-based flat text categorization produced slightly better results than kNN-based HTC on the largest TanCorpHier and 20NGHier datasets, SVM-based HTC results do not considerably differ from the corresponding flat techniques, due to shallow hierarchies; still, they outperform both kNN-based flat and hierarchical categorization on all corpora except the smallest Reuters-Hier1 and Reuters-Hier2 datasets. Formal evaluation confirmed that the proposed techniques obtained state-of-the-art results.

Key words

hierarchical text categorization, n-grams, kNN, SVM

Digital Object Identifier (DOI)


Publication information

Volume 14, Issue 1 (January 2017)
Year of Publication: 2017
ISSN: 1820-0214 (Print) 2406-1018 (Online)
Publisher: ComSIS Consortium

Full text

DownloadAvailable in PDF
Portable Document Format

How to cite

Graovac, J., Kovačević, J., Pavlović-Lažetić, G.: Hierarchical vs. flat n-gram-based text categorization: can we do better?. Computer Science and Information Systems, Vol. 14, No. 1, 103–121. (2017), https://doi.org/10.2298/CSIS151017030G