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 predict(self, sentence: str) -> JsonDict:
      return self.predict_json({"sentence": sentence})
  
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 1 for calling the TextClassifierPredictor obj's underlying member method code with example usage: obj.predict(sentence) and returns: self