tagoyal / sow-reap-paraphrasing

Contains data/code for the paper "Neural Syntactic Preordering for Controlled Paraphrase Generation" (ACL 2020).
77 stars 9 forks source link

Paraphrasing custom data and pythonic dependencies #2

Closed atreyasha closed 4 years ago

atreyasha commented 4 years ago

First off, thank you for the insightful paper and for releasing your code. I would like to use your model(s) to ultimately paraphrase some custom datasets for machine translation tasks.

I was wondering which functions could I use for generating paraphrases on custom data? I looked through README.md under inference, but I think the instructions with input files like sample_test_baseline.txt only apply when there are gold paraphrases.

Thank you for your time.

tagoyal commented 4 years ago

The code doesn't really use the gold paraphrase for generation, only uses it to compute the perplexity. So you could provide any dummy gold paraphrase as input and ignore the perplexity and gold paraphrase outputs in the output file.

Hope this helps!

atreyasha commented 4 years ago

Thank you for the clarification, I will try that out. Closing this issue.

atreyasha commented 4 years ago

Additionally:

  1. Could you push a requirements.txt file? That would help with syncing dependencies.

  2. Which python version did you use for your experiments?

tagoyal commented 4 years ago

done. let me know if you face other issues!

Also fixed other bugs, please clone the repo again.

atreyasha commented 4 years ago

Awesome, thank you :+1:

atreyasha commented 4 years ago

Regarding requirements.txt:

mock==2.0.0
numpy==1.17.1
h5py==2.9.0
six==1.12.0
~orch==1.2.0
torchvision==0.4.0
adabound==0.0.5
bokeh==2.0.2
hyperdash==0.15.3
pandas==1.0.3
scikit_learn==0.23.0
torch==1.5.0

Pip failed deciphering ~orch and torch. I am guessing there was a typo and it should be torch. Which version is the correct one, 1.2.0 or 1.5.0?

tagoyal commented 4 years ago

It's version 1.5.0 will fix.

atreyasha commented 4 years ago

I see. I changed it locally and tried re-installing, but pip outputs a warning:

"ERROR: torchvision 0.4.0 has requirement torch==1.2.0, but you'll have torch 1.5.0 which is incompatible."

I have not tested, but would this break something in the pipeline?

tagoyal commented 4 years ago

hm, this is weird, this is the exact output of my pip freeze

torch==1.5.0 torchvision==0.4.0

Though downgrading it shouldn't break anything in the code.

atreyasha commented 4 years ago

Hmm, yes strange. I tested with torch==1.2.0 and everything still works. I think I will keep it at this version because our servers are not configured with the latest CUDA versions required for 1.5.0 :/

TITC commented 3 years ago

same with you

hm, this is weird, this is the exact output of my pip freeze

torch==1.5.0 torchvision==0.4.0

Though downgrading it shouldn't break anything in the code.


INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of mock to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r /content/sow-reap-paraphrasing/requirements.txt (line 5) and torch==1.5.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested torch==1.5.0
    torchvision 0.4.0 depends on torch==1.2.0