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","."]
code: def _init_model_with_state_dict(cls, state, **kwargs):
      import re
  
      # remap state dict for models serialized with Flair <= 0.11.3
      state_dict = state["state_dict"]
      for key in list(state_dict.keys()):
          state_dict[
              re.sub("^document_embeddings\\.", "embeddings.", key)
          ] = state_dict.pop(key)
  
      return super()._init_model_with_state_dict(
          state,
          embeddings=state.get("document_embeddings"),
          label_dictionary=state.get("label_dictionary"),
          label_type=state.get("label_type"),
          multi_label=state.get("multi_label"),
          multi_label_threshold=state.get("multi_label_threshold", 0.5),
          loss_weights=state.get("weight_dict"),
          **kwargs,
      )
  
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 5 for calling the TextClassifier obj's underlying member method code with example usage: obj._init_model_with_state_dict(cls, state) and returns: super