Yeah this is similar to what I want. I need to be able to give categories to different words or sets of words and then feed it a large piece of text and I need it to figure out which category each word in that text belongs to. It is working fairly well with the Apple Word Tagger on iOS even with a small set of training data.