This chapter addresses text clustering using a variety of graph-based algorithms, including the Fiedler method, the Kernighan–Lin method, text categorization with min-cuts, betweenness, and random walks.
Text clustering is a technique that is frequently used to organize collections of documents, and it is often used in conjunction with other tasks such as information retrieval and topic identification. The goal of text clustering is to partition a given set of documents into meaningful classes, without assuming a predefined list of categories. For example, given a collection of documents that contain the word apple, a text categorizer would divide the documents into two major clusters, one pertaining to computers (related to the meaning of Apple Macintosh) and the other pertaining to food and agriculture (related to the meaning of apple fruits and trees). A sample set of documents and the resulting clusters are illustrated in Figure 6.1.
Clustering can be either flat, in which all clusters are at the same level, or hierarchical, in which the clusters are organized into a hierarchy, which is often represented as a tree structure, or a dendrogram. Assuming the example in Figure 6.1, a hierarchical clustering algorithm would further divide the cluster on food and agriculture into two smaller clusters, one pertaining to apple trees and the other to apple fruits. The corresponding dendrogram is shown in Figure 6.2.
The quality of an automatically generated set of clusters is usually measured using two metrics considered standard in clustering evaluation – namely, purity and entropy (Zhao and Karypis 2001), which are computed for the automatically generated sense groupings relative to the “goldstandard” clusters (i.e., clusters that are considered correct for the purpose of evaluation).