class_docstr: TextClassificationModel to be trained on two- or three-class textual entailment data, to be used for zero shot intent recognition.
class_docstr_tok: ["TextClassificationModel","to","be","trained","on","two-","or","three-class","textual","entailment","data",",","to","be","used","for","zero","shot","intent","recognition","."]
code: def setup_training_data(
      self, train_data_config: Optional[DictConfig]
  ):
      if not train_data_config:
          logging.info(
              f"Dataloader config or file_name for the training set is missing, so no data loader for test is created!"
          )
          self._test_dl = None
          return
      self._train_dl = self._setup_dataloader_from_config(
          train_data_config, "train"
      )
  
      # calculate the class weights to be used in the loss function
      if self.cfg.dataset.class_balancing == "weighted_loss":
          self.class_weights = calc_class_weights_from_dataloader(
              self._train_dl,
              self.cfg.dataset.num_classes,
              self.cfg.dataset.data_dir,
          )
      else:
          self.class_weights = None
      # we need to create/update the loss module by using the weights calculated from the training data
      self.create_loss_module()
  
imports: import os
  from collections import defaultdict
  from typing import Dict, List, Optional, Union
  import numpy
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from transformers import AutoModelForSequenceClassification, AutoTokenizer
  from nemo.collections.nlp.data.dialogue import DialogueSGDDataProcessor
  from nemo.collections.nlp.data.dialogue.data_processor.assistant_data_processor import DialogueAssistantDataProcessor
  from nemo.collections.nlp.data.dialogue.data_processor.design_data_processor import DialogueDesignDataProcessor
  from nemo.collections.nlp.data.dialogue.dataset.dialogue_zero_shot_intent_dataset import DialogueZeroShotIntentDataset
  from nemo.collections.nlp.data.zero_shot_intent_recognition.zero_shot_intent_dataset import ZeroShotIntentInferenceDataset, calc_class_weights_from_dataloader
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.metrics.dialogue_metrics import DialogueGenerationMetrics
  from nemo.collections.nlp.models import TextClassificationModel
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 4 for calling the DialogueZeroShotIntentModel obj's underlying member method code with example usage: obj.setup_training_data(train_data_config) without return types