Learning Disentangled Meaning and Style Representations for Positive Text Reframing 🔗
The code of is developed on nlpe, a python package for processing NLP experiments.
- MSCOCO: used to create the pseudo paraphrase generation dateset for PTR.
- Yelp: used to create the pseudo sentiment transfer dateset for PTR.
- PPF: used to evaluate methods for PTR.
Source of data: MSCOCO (version from here), Yelp (version from here), PPF
- Git
- Python >= 3.11
- CUDA 12.6 (if NVIDIA GPU is available)
Clone the repository.
git clone https://github.com/codesedoc/DMSR.git
cd DMSR
conda env create -f conda/environment_linux-64.yml # for linxu-64 platform
# conda env create -f conda/environment_oxs-arm64.yml # for oxs-arm64 (Mac Silicon) platform
# conda env create -f conda/environment_win-64.yml # for win-64 platform
conda activate dmsr
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py -t ptr -d ppf --dataset_raw_dir storage/dataset/ppf/raw -a dmsr --output_dir tmp --do_train --do_eval --do_predict
- -d [name of dataset]
- -t [name of task]
- --dataset_raw_dir [path of dataset dir]
- -a [name of approach]
- --debug : Swith on debug mode
- --variant [name of variant of backbone model]: One of ("base", "st", "pg", "st2pg", "pg2st") is available, default is base.
- --checkpoint [path of trained model]: It is used for only do evaluation on validation/test set.
- --backbone [name of PLM used as backbone model]: One of ("t5", "bart") is available, default is t5.
- --output_dir [path of output dir]
- --do_train: Conduct train
- --do_eval: Conduct evaluation on validation set
- --do_predict: Conduct evaluation on test set
The other usages of transformers TrainiArgument can be referred to here.
@inproceedings{
sheng-etal-2023-learning,
title = "Learning Disentangled Meaning and Style Representations for Positive Text Reframing",
author = "Sheng, Xu and
Fukumoto, Fumiyo and
Li, Jiyi and
Kentaro, Go and
Suzuki, Yoshimi",
booktitle = "Proceedings of the 16th International Natural Language Generation Conference",
month = sep,
year = "2023",
address = "Prague, Czechia",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.inlg-main.31",
pages = "424--430",
}