1. A computer-implemented method comprising: receiving a dataset of text sequences extracted from document images; automatically identifying a set of patterns in the text sequences; filtering the patterns to generate a set of features, the filtering comprising at least one of: filtering out redundant patterns, and filtering out irrelevant patterns; and outputting at least some of the features in the set of features.