1. A method comprising: identifying terms in a document to be classified; generating one or more class candidates for said document from a plurality of classes based on a query; assigning a first rank to each of the class candidates based on at least one of a positive-weight, negative-weight, and null-weight keyword associated with said class candidates; and assigning the document to one of the class candidates.