class_docstr: Dialogue Nearest Neighbour Model identifies the intent of an utterance using the cosine similarity between sentence embeddings of the utterance and various label descriptions 
class_docstr_tok: ["Dialogue","Nearest","Neighbour","Model","identifies","the","intent","of","an","utterance","using","the","cosine","similarity","between","sentence","embeddings","of","the","utterance","and","various","label","descriptions"]
code: def __init__(self, cfg: DictConfig, trainer: Trainer = None):
      self.cfg = cfg
      super().__init__(cfg=cfg, trainer=trainer)
      if self.cfg.library == "huggingface":
          self.language_model = AutoModel.from_pretrained(
              self.cfg.language_model.pretrained_model_name
          )
  
imports: import os
  from typing import Optional
  import numpy
  import torch
  import torch.nn.functional
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from transformers import AutoModel
  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_nearest_neighbour_dataset import DialogueNearestNeighbourDataset
  from nemo.collections.nlp.metrics.classification_report import ClassificationReport
  from nemo.collections.nlp.metrics.dialogue_metrics import DialogueGenerationMetrics
  from nemo.collections.nlp.models.nlp_model import NLPModel
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.utils import logging
label_desc: Use image node_id 1 to create a new DialogueNearestNeighbourModel object from inherited base classes: NLPModel with example: obj = DialogueNearestNeighbourModel(cfg, trainer)