Refine query subtype, add support for training with subtype and classify to multi classes