princeton-nlp / LM-BFF

[ACL 2021] LM-BFF: Better Few-shot Fine-tuning of Language Models https://arxiv.org/abs/2012.15723

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I create templates for right to left languages?

moeyad7 opened this issue · comments

I am trying to apply LM-BFF to some sentiment analysis datasets and Named Entity Recognition in Arabic. I am having difficulties in creating the templates as the order in which I write the template in is not what is outputted when I run the model.

12/17/2023 21:53:54 - INFO - __main__ -   | *cls**sent_0*كانت**mask*.*sep+* => *cls**sent_0*كانت**mask*.*sep+**sent_1*كانت**label_0*.*sep+**sent_2*كانت**label_1*.*sep+*

According to the pattern, I wrote the template should output [CLS] sent_0 كانت [MASK]. [SEP] sent_1 كانت [MASK]. [SEP] but the output that is returned is [CLS] كانت sent_0 [MASK]. [SEP] sent_1 كانت [MASK]. [SEP]. For some reason the first part of the template get switched I don't know if its because I am using a right to left language or if my template is wrong.