qkaren / COLD_decoding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code for "COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics"

This is the code for the following paper:

[COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics] (https://arxiv.org/pdf/2202.11705.pdf)
Lianhui Qin, Sean Welleck, Daniel Khashabi, Yejin Choi

1) Setup Environment

pip install -r requirements.txt

2) Download this Github

git clone https://github.com/qkaren/COLD_decoding.git

3) Run Command for COLD Decoding

  • CommonGen
sh commongen.sh
  • Abductive Reasoning
sh abductive.sh
  • Counterfactual Reasoning
sh counterfactual.sh

4) Rank the generation

will add soon

About

License:Apache License 2.0


Languages

Language:Python 98.4%Language:Shell 1.6%