1. A method comprising: classifying a set of probabilistic attributes in an N-gram language model into a plurality of classes; clustering each resultant class into a plurality of segments to build a codebook for the respective class using a modified K-means clustering process which dynamically adjusts the size and centroid of each segment during each iteration in the modified K-means clustering process; and representing a probabilistic attribute in each class by the centroid of the corresponding segment to which the respective probabilistic attribute belongs.