docstr: In basic manual template, the parameters are generated from label words directly.
  In this implementation, the label_words should not be tokenized into more than one token.
docstr_tok: ["In","basic","manual","template",",","the","parameters","are","generated","from","label","words","directly",".","In","this","implementation",",","the","label_words","should","not","be","tokenized","into","more","than","one","token","."]
code: def generate_parameters(self) -> List:
      r"""In basic manual template, the parameters are generated from label words directly.
      In this implementation, the label_words should not be tokenized into more than one token.
      """
      all_ids = []
      for words_per_label in self.label_words:
          ids_per_label = []
          for word in words_per_label:
              ids = self.tokenizer.encode(
                  word,
                  add_special_tokens=False,
                  return_token_type_ids=False,
              )["input_ids"]
              ids_per_label.append(ids)
          all_ids.append(ids_per_label)
  
      max_len = max(
          [
              max([len(ids) for ids in ids_per_label])
              for ids_per_label in all_ids
          ]
      )
      max_num_label_words = max(
          [len(ids_per_label) for ids_per_label in all_ids]
      )
      words_ids_mask = paddle.zeros([max_num_label_words, max_len])
      words_ids_mask = [
          [
              [1] * len(ids) + [0] * (max_len - len(ids))
              for ids in ids_per_label
          ]
          + [[0] * max_len] * (max_num_label_words - len(ids_per_label))
          for ids_per_label in all_ids
      ]
      words_ids = [
          [ids + [0] * (max_len - len(ids)) for ids in ids_per_label]
          + [[0] * max_len] * (max_num_label_words - len(ids_per_label))
          for ids_per_label in all_ids
      ]
  
      words_ids_tensor = paddle.to_tensor(words_ids)
      words_ids_mask = paddle.to_tensor(words_ids_mask)
      self.label_words_ids = words_ids_tensor
      self.words_ids_mask = words_ids_mask
      self.label_words_mask = paddle.clip(
          self.words_ids_mask.sum(axis=-1), max=1
      )
  
imports: import paddle
  from abc import abstractmethod
  from typing import *
  import numpy
  import paddle.nn.functional
label_desc: Use image node_id 7 for calling the ErnieManualVerbalizer obj's underlying member method code with example usage: obj.generate_parameters() without return types