Skip to content

Latest commit

 

History

History

self_critique

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Note:

The code is based on Huggingface transformer examples: question-answering

Instruction:

Data preprocess:

# From the repository root:
python preprocess/reconstruct.py
python preprocess/genqa_joint.py
python preprocess/entailment.py

Train:

This subproject uses PDM to manage dependencies and virtual environments. To install PDM, run: check their website.

Python 3.10+ is required. I recommend using pyenv to manage Python versions.

After that, run the following commands to install dependencies and create a virtual environment:

pdm install
source .venv/bin/activate

Train joint extraction and classification model:

python self_critique/minimal/seq2seq.py --config config/extraction.json

Train reconstruction model:

python self_critique/minimal/seq2seq.py --config config/reconstruct.json

Train text entailment model:

python self_critique/minimal/entailment.py --config config/entailment_deberta.json

Train Reinforcement Learning model:

cd self_critique/rl
python train.py --config config.json