pip install -r requirements.txt
Generate the ConsTRev's constraint instruction with: python put_constraint.py
Build the planner:
- Create synthetic trajectory using GPT-4o with:
python create_syn_data_from_gpt4o.py
- Build an initial planner:
a. Go to
finetune/train_script
folder. b. Runbash run.sh
script. - Build self-training data with:
python create_self_training_data.py
- Enhance the planner via self-training:
a. Go to
align/runs
folder. b. Runbash llama3_instruct_cpo_simpo.sh
script. - Iterate through steps 3 and 4.
Run Search:
- Go to the MCTS folder.
- Pass in the path for the planner and reviser in the
run.sh
file. - run
bash run.sh
script.
- Test data is in
data/test_input
folder. - Prediction data is in
data/output
folder.
If you found our paper or code useful, please cite as:
@inproceedings{cao-ng-2025-craft,
title = "A Constrained Text Revision Agent via Iterative Planning and Searching",
author = "Cao, Hannan and
Ng, Hwee Tou",
booktitle = "Findings of the Association for Computational Linguistics: ACL 2025",
year = "2025",
}