Uses bags of words to recognize the category words belong in.