class_docstr: The basic manually defined verbalizer class, this class is inherited from the :obj:`Verbalizer` class.
  This class restrict the use of label words to one words per label. For a verbalzer with less constraints,
  please use Basic ManualVerbalizer.
  
  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.
      num_classes (:obj:`int`): Optional. The number of classes of the verbalizer. Only one of `classes` and `num_classes` should be used.
      label_words (:obj:`Union[Sequence[str], Mapping[str, str]]`, optional): The label words that are projected by the labels.
      prefix (:obj:`str`, optional): The prefix string of the verbalizer. (used in PLMs like RoBERTa, which is sensitive to prefix space)
      multi_token_handler (:obj:`str`, optional): The handling strategy for multiple tokens produced by the tokenizer.
      post_log_softmax (:obj:`bool`, optional): Whether to apply log softmax post processing on label_logits. Default to True.
class_docstr_tok: ["The","basic","manually","defined","verbalizer","class",",","this","class","is","inherited","from","the",":","obj",":","`","Verbalizer","`","class",".","This","class","restrict","the","use","of","label","words","to","one","words","per","label",".","For","a","verbalzer","with","less","constraints",",","please","use","Basic","ManualVerbalizer",".","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",".","num_classes","(",":","obj",":","`","int","`",")",":","Optional",".","The","number","of","classes","of","the","verbalizer",".","Only","one","of","`","classes","`","and","`","num_classes","`","should","be","used",".","label_words","(",":","obj",":","`","Union","[","Sequence","[","str","]",",","Mapping","[","str",",","str","]","]","`",",","optional",")",":","The","label","words","that","are","projected","by","the","labels",".","prefix","(",":","obj",":","`","str","`",",","optional",")",":","The","prefix","string","of","the","verbalizer",".","(","used","in","PLMs","like","RoBERTa",",","which","is","sensitive","to","prefix","space",")","multi_token_handler","(",":","obj",":","`","str","`",",","optional",")",":","The","handling","strategy","for","multiple","tokens","produced","by","the","tokenizer",".","post_log_softmax","(",":","obj",":","`","bool","`",",","optional",")",":","Whether","to","apply","log","softmax","post","processing","on","label_logits",".","Default","to","True","."]
docstr: A whole framework to process the original logits over the vocabulary, which contains four steps:
  
  (1) Project the logits into logits of label words
  
  if self.post_log_softmax is True:
  
      (2) Normalize over all label words
  
      (3) Calibrate (optional)
  
  Args:
      logits (:obj:`torch.Tensor`): The original logits.
  
  Returns:
      (:obj:`torch.Tensor`): The final processed logits over the label words set.
docstr_tok: ["A","whole","framework","to","process","the","original","logits","over","the","vocabulary",",","which","contains","four","steps",":","(","1",")","Project","the","logits","into","logits","of","label","words","if","self.post_log_softmax","is","True",":","(","2",")","Normalize","over","all","label","words","(","3",")","Calibrate","(","optional",")","Args",":","logits","(",":","obj",":","`","torch.Tensor","`",")",":","The","original","logits",".","Returns",":","(",":","obj",":","`","torch.Tensor","`",")",":","The","final","processed","logits","over","the","label","words","set","."]
code: def process_logits(self, logits: torch.Tensor, **kwargs):
      r"""A whole framework to process the original logits over the vocabulary, which contains four steps:
  
      (1) Project the logits into logits of label words
  
      if self.post_log_softmax is True:
  
          (2) Normalize over all label words
  
          (3) Calibrate (optional)
  
      Args:
          logits (:obj:`torch.Tensor`): The original logits.
  
      Returns:
          (:obj:`torch.Tensor`): The final processed logits over the label words set.
      """
      # project
      label_words_logits = self.project(
          logits, **kwargs
      )  # Output: (batch_size, num_classes) or  (batch_size, num_classes, num_label_words_per_label)
  
      if self.post_log_softmax:
          # normalize
          label_words_probs = self.normalize(label_words_logits)
  
          # calibrate
          if (
              hasattr(self, "_calibrate_logits")
              and self._calibrate_logits is not None
          ):
              label_words_probs = self.calibrate(
                  label_words_probs=label_words_probs
              )
  
          # convert to logits
          label_words_logits = torch.log(label_words_probs + 1e-15)
  
      return label_words_logits
  
imports: import json
  from transformers.tokenization_utils import PreTrainedTokenizer
  from yacs.config import CfgNode
  from openprompt.data_utils import InputFeatures
  import re
  from openprompt import Verbalizer
  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 One2oneVerbalizer obj's underlying member method code with example usage: obj.process_logits(logits) and returns: label_words_logits