text_classifier
[ allennlp.predictors.text_classifier ]
TextClassifierPredictor Objects#
class TextClassifierPredictor(Predictor)
Predictor for any model that takes in a sentence and returns
a single class for it. In particular, it can be used with
the BasicClassifier
model.
Registered as a Predictor
with name "text_classifier".
predict#
| def predict(self, sentence: str) -> JsonDict
predictions_to_labeled_instances#
| @overrides
| def predictions_to_labeled_instances(
| self,
| instance: Instance,
| outputs: Dict[str, numpy.ndarray]
| ) -> List[Instance]