class_docstr: Text Classification Model.
  
  The model takes word embeddings, puts them into an RNN to obtain a text
  representation, and puts the text representation in the end into a linear
  layer to get the actual class label. The model can handle single and multi
  class data sets.
class_docstr_tok: ["Text","Classification","Model",".","The","model","takes","word","embeddings",",","puts","them","into","an","RNN","to","obtain","a","text","representation",",","and","puts","the","text","representation","in","the","end","into","a","linear","layer","to","get","the","actual","class","label",".","The","model","can","handle","single","and","multi","class","data","sets","."]
docstr: Initializes a TextClassifier.
  
  Args:
      embeddings: embeddings used to embed each data point
      label_dictionary: dictionary of labels you want to predict
      label_type: string identifier for tag type
      multi_label: auto-detected by default, but you can set this to True to force multi-label predictions
          or False to force single-label predictions.
      multi_label_threshold: If multi-label you can set the threshold to make predictions
      beta: Parameter for F-beta score for evaluation and training annealing
      loss_weights: Dictionary of weights for labels for the loss function. If any label's weight is
          unspecified it will default to 1.0
      **classifierargs: The arguments propagated to :meth:`flair.nn.DefaultClassifier.__init__`
docstr_tok: ["Initializes","a","TextClassifier",".","Args",":","embeddings",":","embeddings","used","to","embed","each","data","point","label_dictionary",":","dictionary","of","labels","you","want","to","predict","label_type",":","string","identifier","for","tag","type","multi_label",":","auto-detected","by","default",",","but","you","can","set","this","to","True","to","force","multi-label","predictions","or","False","to","force","single-label","predictions",".","multi_label_threshold",":","If","multi-label","you","can","set","the","threshold","to","make","predictions","beta",":","Parameter","for","F-beta","score","for","evaluation","and","training","annealing","loss_weights",":","Dictionary","of","weights","for","labels","for","the","loss","function",".","If","any","label","'s","weight","is","unspecified","it","will","default","to","1.0","*","*","classifierargs",":","The","arguments","propagated","to",":","meth",":","`","flair.nn.DefaultClassifier.__init__","`"]
code: def __init__(
      self,
      embeddings: flair.embeddings.DocumentEmbeddings,
      label_type: str,
      **classifierargs,
  ) -> None:
      """Initializes a TextClassifier.
  
      Args:
          embeddings: embeddings used to embed each data point
          label_dictionary: dictionary of labels you want to predict
          label_type: string identifier for tag type
          multi_label: auto-detected by default, but you can set this to True to force multi-label predictions
              or False to force single-label predictions.
          multi_label_threshold: If multi-label you can set the threshold to make predictions
          beta: Parameter for F-beta score for evaluation and training annealing
          loss_weights: Dictionary of weights for labels for the loss function. If any label's weight is
              unspecified it will default to 1.0
          **classifierargs: The arguments propagated to :meth:`flair.nn.DefaultClassifier.__init__`
      """
      super().__init__(
          **classifierargs,
          embeddings=embeddings,
          final_embedding_size=embeddings.embedding_length,
      )
  
      self._label_type = label_type
  
      # auto-spawn on GPU if available
      self.to(flair.device)
  
file_path: flair/flair/models/text_classification_model.py
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Union
  import torch
  import flair.embeddings
  import flair.nn
  from flair.data import Sentence
  from flair.file_utils import cached_path
label_desc: Use image node_id 1 to create a new TextClassifier object from inherited base classes: flair.nn.DefaultClassifier with example: obj = TextClassifier(embeddings, label_type)