timoschick / pet

This repository contains the code for "Exploiting Cloze Questions for Few-Shot Text Classification and Natural Language Inference"
https://arxiv.org/abs/2001.07676
Apache License 2.0
1.62k stars 285 forks source link

Why the pml's output is sum of different verbalizations, is not the max of different verbalization ? #63

Closed wa008 closed 2 years ago

wa008 commented 2 years ago

Thanks for sharing code!!!, I have a little question.

You can also define multiple verbalizations for a single label. For example, if you are unsure which words best represent the labels in a binary sentiment classification task, you could define your verbalizer as follows: VERBALIZER = {"+1": ["great", "good", "wonderful", "perfect"], "-1": ["bad", "terrible", "horrible"]}

If we want find the best represent verbalizations, Why the pml's output is sum of different verbalizations, is not the max of different verbalization? cls_logits = cls_logits.sum(axis=1) / filler_len in line 229 of code

Thank very much

wa008 commented 2 years ago

Sorry, I think I know, because every verbalizations hava some probability to be outputed