1. A method for processing information, comprising: receiving a set of records, which comprise a plurality of fields containing data regarding respective items; selecting a field that occurs in all of the records and contains multiple terms in each of the records; identifying, by at least one processor in a computer, at least first and second terms that occur among the terms in the selected field in the records, such that the records are partitioned into at least first and second respective subsets by occurrences of the at least first and second terms in the selected field, wherein identifying the at least first and second terms comprises identifying a first group of the terms that are associated with a first attribute of the items; determining, responsively to partitioning of the records by the occurrences, that the at least first and second terms correspond to at least first and second different values of the first attribute of the items; after identifying the first group, identifying a second group of the terms, which is disjoint from the first group and partitions the records into different respective subsets from the terms in the first group, and determining that the terms in the second group correspond to respective values of a second attribute of the items; and classifying the data according to the values of the first attribute and outputting the classified data.