def generate_parameters(self) -> List:
    'In basic manual template, the parameters are generated from label words directly.\n        In this implementation, the label_words should not be tokenized into more than one token.\n        '
    words_ids = []
    for word in self.label_words:
        word_ids = self.tokenizer.encode(word, add_special_tokens=False)
        if (len(word_ids) > 1):
            logger.warning('Word {} is split into multiple tokens: {}.                     If this is not what you expect, try using another word for this verbalizer'.format(word, self.tokenizer.convert_ids_to_tokens(word_ids)))
        words_ids.append(word_ids)
    max_len = max([len(ids) for ids in words_ids])
    words_ids_mask = [(([1] * len(ids)) + ([0] * (max_len - len(ids)))) for ids in words_ids]
    words_ids = [(ids + ([0] * (max_len - len(ids)))) for ids in words_ids]
    words_ids_tensor = torch.tensor(words_ids)
    words_ids_mask = torch.tensor(words_ids_mask)
    self.label_words_ids = nn.Parameter(words_ids_tensor, requires_grad=False)
    self.label_words_mask = nn.Parameter(words_ids_mask, requires_grad=False)
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.
def generate_parameters(self) -> List:
    'In basic manual template, the parameters are generated from label words directly.\n        In this implementation, the label_words should not be tokenized into more than one token.\n        '
    words_ids = []
    for word in self.label_words:
        word_ids = self.tokenizer.encode(word, add_special_tokens=False)
        if (len(word_ids) > 1):
            logger.warning('Word {} is split into multiple tokens: {}.                     If this is not what you expect, try using another word for this verbalizer'.format(word, self.tokenizer.convert_ids_to_tokens(word_ids)))
        words_ids.append(word_ids)
    max_len = max([len(ids) for ids in words_ids])
    words_ids_mask = [(([1] * len(ids)) + ([0] * (max_len - len(ids)))) for ids in words_ids]
    words_ids = [(ids + ([0] * (max_len - len(ids)))) for ids in words_ids]
    words_ids_tensor = torch.tensor(words_ids)
    words_ids_mask = torch.tensor(words_ids_mask)
    self.label_words_ids = nn.Parameter(words_ids_tensor, requires_grad=False)
    self.label_words_mask = nn.Parameter(words_ids_mask, requires_grad=False)