class_docstr: 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`](../models/basic_classifier.md) model.
  
  Registered as a `Predictor` with name "text_classifier".
class_docstr_tok: ["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","`","]","(","..","\/models\/basic_classifier.md",")","model",".","Registered","as","a","`","Predictor","`","with","name","``","text_classifier","''","."]
code: def predictions_to_labeled_instances(
      self, instance: Instance, outputs: Dict[str, numpy.ndarray]
  ) -> List[Instance]:
      new_instance = instance.duplicate()
      label = numpy.argmax(outputs["probs"])
      new_instance.add_field(
          "label", LabelField(int(label), skip_indexing=True)
      )
      return [new_instance]
  
file_path: allennlp/allennlp/predictors/text_classifier.py
imports: from typing import List, Dict
  import numpy
  from allennlp.common.util import JsonDict
  from allennlp.data import Instance
  from allennlp.predictors.predictor import Predictor
  from allennlp.data.fields import LabelField
  from allennlp.data.tokenizers.spacy_tokenizer import SpacyTokenizer
label_desc: Use image node_id 3 for calling the TextClassifierPredictor obj's underlying member method code with example usage: obj.predictions_to_labeled_instances(instance, outputs) and returns: list