class_docstr: This is the implementation of knowledeagble verbalizer, which uses external knowledge to expand the set of label words.
  This class inherit the ``ManualVerbalizer`` class.
  
  Args:
      tokenizer (:obj:`PreTrainedTokenizer`): The tokenizer of the current pre-trained model to point out the vocabulary.
      classes (:obj:`classes`): The classes (or labels) of the current task.
      prefix (:obj:`str`, optional): The prefix string of the verbalizer.
      multi_token_handler (:obj:`str`, optional): The handling strategy for multiple tokens produced by the tokenizer.
      max_token_split (:obj:`int`, optional):
      verbalizer_lr (:obj:`float`, optional): The learning rate of the verbalizer optimization.
      candidate_frac (:obj:`float`, optional):
docstr: For Knowledgeable Verbalizer, it's nessessory to filter the words with has low prior probability.
  Therefore we re-compute the label words after register calibration logits.
docstr_tok: ["For","Knowledgeable","Verbalizer",",","it","'s","nessessory","to","filter","the","words","with","has","low","prior","probability",".","Therefore","we","re-compute","the","label","words","after","register","calibration","logits","."]
code: def register_calibrate_logits(self, logits: torch.Tensor):
      r"""For Knowledgeable Verbalizer, it's nessessory to filter the words with has low prior probability.
      Therefore we re-compute the label words after register calibration logits.
      """
      if logits.requires_grad:
          logits = logits.detach()
      self._calibrate_logits = logits
      cur_label_words_ids = self.label_words_ids.data.cpu().tolist()
      rm_calibrate_ids = set(
          torch.argsort(self._calibrate_logits)[
              : int(self.candidate_frac * logits.shape[-1])
          ]
          .cpu()
          .tolist()
      )
  
      new_label_words = []
      for i_label, words_ids_per_label in enumerate(
          cur_label_words_ids
      ):
          new_label_words.append([])
          for j_word, word_ids in enumerate(words_ids_per_label):
              if j_word >= len(self.label_words[i_label]):
                  break
              if (
                  len(
                      (set(word_ids).difference(set([0]))).intersection(
                          rm_calibrate_ids
                      )
                  )
                  == 0
              ):
                  new_label_words[-1].append(
                      self.label_words[i_label][j_word]
                  )
      self.label_words = new_label_words
      self.to(self._calibrate_logits.device)
  
imports: import os
  from openprompt.prompts.manual_template import ManualTemplate
  from transformers.tokenization_utils import PreTrainedTokenizer
  from transformers.utils.dummy_pt_objects import PreTrainedModel
  from openprompt.data_utils import InputFeatures
  import re
  from openprompt.prompts.manual_verbalizer import ManualVerbalizer
  from typing import *
  import torch
  import torch.nn
  import torch.nn.functional
  from openprompt.utils.logging import logger
label_desc: Use image node_id 6 for calling the KnowledgeableVerbalizer obj's underlying member method code with example usage: obj.register_calibrate_logits(logits) without return types