LM for multiple classes

While using learner from text, by default it uses the next word it’s going to predict for evaluation. It outputs 2 classes (pos and neg) by default. What can be done to use it for multiple classes and can we use correctness of those classes (like we use for cnn) for calculation of loss ?