This is the implementation of RSA-Control from "RSA-Control: A Pragmatics-Grounded Lightweight Controllable Text Generation Framework". The work will appear in the EMNLP, 2024.
Our codes require transformers==4.38.2
.
To reproduce results from the paper, please run:
python toxicity_bias_mitigation/detoxification.py --output_dir detoxification_results --api_key YOUR_PERSPECTIVE_API_KEY --adjustable --two_models
python toxicity_bias_mitigation/crows_pairs_experiments.py --output_dir debiasing_results --adjustable --two_models
python readability_controlled_summarization/readability_controlled_summarization.py --output_dir readability_control_results --adjustable
CrowS-Pairs and RealToxicityPrompts datasets for toxicity and bias reduction experiments can be found in toxicity_bias_mitigation/data/
, and we use CNN/DM from huggingface transformers.