mireshghallah / mixmatch

Repository for ACL 2022 paper Mix and Match: Learning-free Controllable Text Generation using Energy Language Models
40 stars 5 forks source link

About Formality Transfer #1

Open poang opened 2 years ago

poang commented 2 years ago

Hi there,I have some questions to ask.

  1. Is the "form_em" folder used to run formal transfer code?
  2. If I use "form_em" to run yelp dataset, should I get sentiment transfer result or form transfer result?

As I said above, if I use sample batched form em len. Py to run yelp dataset, I got "definitely disappointed that i could not use my birthday gift !" --> "so upset that i may never get this amazing gift !" And the label is fliped.

How can I change the sentence form without changing sentiment?

Thank you !

mireshghallah commented 2 years ago

hey! form_em is for formality transfer, so if you run form_em, using a "formality discriminator", on top of yelp dataset, it should try and change the formality of yelp samples (which doesn't really make sense because they are all kind of informal, but not too informal).

If you want to do formality transfer, you should run the form_em on form_em datafiles using formality discriminator.

I am not entirely sure what you ran, but my guess is you were probably using a sentiment classifier with the form_em code, that's why it is doing what seems to be sentiment transfer. hope this helps!

poang commented 2 years ago

hey! form_em is for formality transfer, so if you run form_em, using a "formality discriminator", on top of yelp dataset, it should try and change the formality of yelp samples (which doesn't really make sense because they are all kind of informal, but not too informal).

If you want to do formality transfer, you should run the form_em on form_em datafiles using formality discriminator.

I am not entirely sure what you ran, but my guess is you were probably using a sentiment classifier with the form_em code, that's why it is doing what seems to be sentiment transfer. hope this helps!

When I ran form_em, I used the default discriminator, called "'textattack/bert-base-uncased-imdb'".Am i right? If not, where do I find the "formality discriminator"?

mireshghallah commented 2 years ago

That classifier is a sentiment classifier. If you want to do formality transfer, you need a formality classifier. You could use the one provided in the checkpoints that I had mentioned in the read me (they are here:https://zenodo.org/record/5855005#.YmSj_y-B1pQ). You need to use the form_em checkpoint.