Sachin19 / mucoco

Official Code for the papers: "Controlled Text Generation as Continuous Optimization with Multiple Constraints" and "Gradient-based Constrained Sampling from LMs"
MIT License
59 stars 6 forks source link

Regarding sentiment-controlled generation scripts #8

Open hayleyson opened 1 year ago

hayleyson commented 1 year ago

Hi @Sachin19,

I checked the sentiment related scripts you kindly pushed to the repository! And there were a minor correction and a question regarding them.

  1. I think in line 31 of your readme file, bash examples/training_constraint_models/train_sentiment_classifier.sh sst2 should be bash examples/training_constraint_models/train_sentiment_classifiers.sh sst2 with s at the end of the shell file name.

  2. In the examples/training_constraint_models/train_sentiment_classifiers.sh file, in line 8, it's executing data/sentiment/create_sst_sentiment_data.py which I currently do not see in the data/sentiment directory. Could it be missing? (I checked if the files currently in the directory could be just renamed and used, and it failed with following error.)

(mucoco2) ~/mucoco$ bash examples/training_constraint_models/train_sentiment_classifiers.sh sst2
download and preprocessing sst data
/home/hyeryungson/mucoco
[3310, 3610]
[428, 444]
[912, 909]
training sst2 classifier
Traceback (most recent call last):
  File "examples/training_constraint_models/train_classifier.py", line 31, in <module>
    train_paths.append(open(f"{base_path}/{sys.argv[3]}_{label}.{filetype}"))
FileNotFoundError: [Errno 2] No such file or directory: 'data/sentiment/sst2/train_0.jsonl'

Thanks! And I want to reiterate that I really enjoyed and appreciated your work. Look forward to exploring it further! :)

Sachin19 commented 1 year ago

Hi Hayley, I apologize for such a long delay in my reply. The file was indeed missing (I forgot to push it). I have pushed it now. I hope it works! Please let me know if the issue persists.

Yu-Fangxu commented 10 months ago

Hi Sachin, The problem Hayley raised is not addressed, train_0.jsonl is still missing. Could you update it? Besides, it seems that other files lack such as iate.414.3.terminology.tsv. I want to follow your work. Thanks, looking forward to your update! :)

Sachin19 commented 10 months ago

Hi,

Please look here: https://github.com/Sachin19/mucoco/blob/sampling2/examples/training_constraint_models/train_sentiment_classifiers.sh . the sst2 dataset is generated by the provided script.

And I have updated the iate files, thanks for pointing it out.

Hope it helps, Sachin