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 forward(self, input_ids, attention_mask, token_type_ids):
      if self.cfg.library == "megatron":
          hidden_states = self.bert_model(
              input_ids=input_ids,
              token_type_ids=token_type_ids,
              attention_mask=attention_mask,
          )
          if isinstance(hidden_states, tuple):
              hidden_states = hidden_states[0]
          logits = self.classifier(hidden_states=hidden_states)
      elif self.cfg.library == "huggingface":
          output = self.nli_model(
              input_ids=input_ids, attention_mask=attention_mask
          )
          logits = output["logits"]
      return logits
  
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 3 for calling the DialogueZeroShotIntentModel obj's underlying member method code with example usage: obj.forward(input_ids, attention_mask, token_type_ids) and returns: logits