# The Influence of Feature Representation of Text on the Performance of Document Classification
## 3 Materials and Methods
### Text Data and Preprocessing  
Table 1 provides an overview of the properties of the four document corpora used in the experiments. They represent a standard set of benchmarks for various natural language processing and text mining tasks and have been used in numerous studies [10; 11; 14; 15; 16; 32; 43; 53; 63].  
The Brown corpus consists of 500 documents of over 2000 tokens each, which are written in a wide range of styles and a variety of prose [19]. There are 15 document classes structured in a taxonomy consisting of four levels with two, four, 10, and 15 class labels, respectively. Therefore, in the experiments, we considered four different document classification tasks related to the Brown corpus, referred to as Brown \(n\), where \(n\) represents the number of class labels (two, four, 10 or 15). We used the version of the Brown corpus included in the Python natural language toolkit [64].  
Reuters8 is a subset of the Reuters-21578 collection of news articles that includes the articles from the eight most frequent classes (acq, crude, earn, grain, interest, money-fx, ship, trade) [22].  
WebKB is a corpus of Web pages collected from computer science departments of four universities in January 1997. The class labels are faculty, staff, department, course, project, student and other. The Web pages are included in the corpus as HTML documents, so we have employed the Python library Beautiful Soup to extract the text from the HTML pages.  
Twenty Newsgroups or 20 News corpus [20] is a set of almost 19 thousand newsgroup posts on twenty topics. In the experiments, we consider each topic to represent a document class label. The corpus was taken from the Python scikit-learn library for machine learning [65].  
Before performing natural language processing, as well as document classification, we had to pre-process the documents. The preprocessing typically includes document tokenization, the removal of stop words and normalization. During tokenization, the document is broken down into lexical tokens. Here, we opted for words.  
The second phase included removing stop words, i.e., the process of removing frequently used words that were the most common, short function words without strong semantic properties that were needed for the syntax of language (as, e.g., pronouns, prepositions, conjunctions, abbreviations and interjections). The list of English stop words was taken from the Python Natural Language Toolkit (NLTK).  
In the last pre-processing phase, we performed the reduction of different inflectional word forms into a single base word form. More specifically, stemming is a simple heuristic process of shortening the different word forms to a common root referred to as a stem. To this end, we employed the implementation of Porter stemming heuristics [66] from NLTK.  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Property/Data Set** & **Brown** & **Reuters8** & **WebKB** & **20 News** \\ \hline \# of documents & 500 & 9460 & 8274 & 18,468 \\ \# of different word stems & 32,174 & 37,074 & 103,847 & 173,296 \\ \hline \# of words (document length) & 541,073 & 851,635 & 1,894,406 & 3,114,002 \\ minimum document length & 188 & 6 & 1 & 10 \\ maximum document length & 957 & 484 & 9294 & 8407 \\ average document length & 593 & 58 & 119 & 111 \\ \hline \# of class labels & 2, 4, 10, 15 & 8 & 7 & 20 \\ labels type & Genre/Topic & Topic & Topic & Topic \\ labels hierarchy & Yes & No & No & No \\ \hline \hline \end{tabular}
\end{table}
Table 1: Properties of the four document classification benchmarks measured on preprocessed documents, that is after the tokenization, removal of stop words and stemming. Document length (minimum, maximum, and average) is measured in number of word stems.