class_docstr: Base class for all the verbalizers.
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): A tokenizer to appoint the vocabulary and the tokenization strategy.
      classes (:obj:`Sequence[str]`): A sequence of classes that need to be projected.
class_docstr_tok: ["Base","class","for","all","the","verbalizers",".","Args",":","tokenizer","(",":","obj",":","`","PreTrainedTokenizer","`",")",":","A","tokenizer","to","appoint","the","vocabulary","and","the","tokenization","strategy",".","classes","(",":","obj",":","`","Sequence","[","str","]","`",")",":","A","sequence","of","classes","that","need","to","be","projected","."]
docstr: sort label words dict of verbalizer to match the label order of the classes
code: def _match_label_words_to_label_ids(
      self, label_words
  ):  # TODO newly add function after docs written # TODO rename this function
      """
      sort label words dict of verbalizer to match the label order of the classes
      """
      if isinstance(label_words, dict):
          if self.classes is None:
              raise ValueError(
                  """
                  classes attribute of the Verbalizer should be set since your given label words is a dict.
                  Since we will match the label word with respect to class A, to A's index in classes
                  """
              )
          if set(label_words.keys()) != set(self.classes):
              raise ValueError(
                  "name of classes in verbalizer are different from those of dataset"
              )
          label_words = [  # sort the dict to match dataset
              label_words[c] for c in self.classes
          ]  # length: label_size of the whole task
      elif isinstance(label_words, list) or isinstance(
          label_words, tuple
      ):
          pass
          # logger.info("""
          # Your given label words is a list, by default, the ith label word in the list will match class i of the dataset.
          # Please make sure that they have the same order.
          # Or you can pass label words as a dict, mapping from class names to label words.
          # """)
      else:
          raise ValueError(
              "Verbalizer label words must be list, tuple or dict"
          )
      return label_words
  
imports: from abc import abstractmethod
  import json
  from transformers.file_utils import ModelOutput
  from openprompt.config import convert_cfg_to_dict
  from transformers.utils.dummy_pt_objects import PreTrainedModel
  from openprompt.utils.utils import signature
  from yacs.config import CfgNode
  from openprompt.data_utils import InputFeatures, InputExample
  import torch
  import torch.nn
  from typing import *
  from transformers.tokenization_utils import PreTrainedTokenizer
  from openprompt.utils.logging import logger
  import numpy
  import torch.nn.functional
label_desc: Use image node_id 4 for calling the Verbalizer obj's underlying member method code with example usage: obj._match_label_words_to_label_ids(label_words) and returns: label_words