{"id":19932091,"url":"https://github.com/amazon-science/controllable-readability-summarization","last_synced_at":"2025-10-27T22:35:15.514Z","repository":{"id":219674984,"uuid":"749598578","full_name":"amazon-science/controllable-readability-summarization","owner":"amazon-science","description":"Generating Summaries with Controllable Readability Levels (EMNLP 2023)","archived":false,"fork":false,"pushed_at":"2025-08-06T19:57:59.000Z","size":328,"stargazers_count":14,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-09T05:03:33.157Z","etag":null,"topics":["controllable","generation","readability","summarization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-science.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-29T02:11:00.000Z","updated_at":"2025-08-05T02:43:08.000Z","dependencies_parsed_at":"2025-04-15T15:28:05.360Z","dependency_job_id":"d9372973-6d8c-4e82-8fb5-c031ea805cfe","html_url":"https://github.com/amazon-science/controllable-readability-summarization","commit_stats":null,"previous_names":["amazon-science/controllable-readability-summarization"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amazon-science/controllable-readability-summarization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcontrollable-readability-summarization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcontrollable-readability-summarization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcontrollable-readability-summarization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcontrollable-readability-summarization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-science","download_url":"https://codeload.github.com/amazon-science/controllable-readability-summarization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-science%2Fcontrollable-readability-summarization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281355372,"owners_count":26486897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["controllable","generation","readability","summarization"],"created_at":"2024-11-12T23:09:00.297Z","updated_at":"2025-10-27T22:35:15.497Z","avatar_url":"https://github.com/amazon-science.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generating Summaries with Controllable Readability Levels (EMNLP 2023)\n\nThis repository contains the code for the paper \"[Generating Summaries with Controllable Readability Levels](https://arxiv.org/pdf/2310.10623)\". \n\nWe developed three text generation techniques for controlling readability:\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/read-control.png\" width=\"400\"\u003e\n\u003c/p\u003e\n\n(a) illustrates the approach to control the summary readability via fine-grained instructions. (b) shows the RL method where given an input document and the readability level, the policy generates a summary to be scored by our Gaussian-based reward, and (c) shows the lookahead approach which uses a readability score of a future summary to guide the generation.\n \n## Environment\n\nThe easiest way to proceed is to create a conda environment:\n```\nconda create -n readability_summ python=3.7\nconda activate readability_summ\n```\n\nFurther, install PyTorch:\n\n```\nconda install pytorch torchvision torchaudio cpuonly -c pytorch\n```\n\nInstall the packages required:\n```\npip install -r requirements.txt\n```\n\nInstall trlx (for the RL method):\n```\ngit clone https://github.com/CarperAI/trlx.git\ncd trlx\npip install torch --extra-index-url https://download.pytorch.org/whl/cu118\npip install -e .\n```\n\n\n## Preprocess data\n\nFor computing the readability scores for CNN/DM, execute:\n\n```\ncd src/preprocess\npython preprocess_cnndm.py\n```\n\nGenerate the prompts:\n```\npython generate_prompts_category.py\npython generate_prompts_score.py\n```\n\n\n## Training\n\nExecute the following commands for training for the prompt-based methods:\n```\ncd src/train\n./train_cnndm.sh\n```\n\nFor the RL method, execute:\n```\ncd src/train/rl\n./train_rl_cnndm.sh\n```\n\n## Inference\n\nFor inference, run:\n```\ncd inference/\n./inference_score.sh \u003ccheckpoint_folder\u003e\n./inference_category.sh \u003ccheckpoint_folder\u003e\n```\n\nFor lookahead inference, run:\n```\n./inference_lookahead.sh \u003ccheckpoint_folder\u003e\n```\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License Summary\n\nThe documentation is made available under the CC-BY-NC-4.0 License. See the LICENSE file.\n\n## Citation\n\n```\n@inproceedings{ribeiro-etal-2023-generating,\n    title = \"Generating Summaries with Controllable Readability Levels\",\n    author = \"Ribeiro, Leonardo F. R.  and\n      Bansal, Mohit  and\n      Dreyer, Markus\",\n    editor = \"Bouamor, Houda  and\n      Pino, Juan  and\n      Bali, Kalika\",\n    booktitle = \"Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing\",\n    month = dec,\n    year = \"2023\",\n    address = \"Singapore\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2023.emnlp-main.714\",\n    doi = \"10.18653/v1/2023.emnlp-main.714\",\n    pages = \"11669--11687\",\n    abstract = \"Readability refers to how easily a reader can understand a written text. Several factors affect the readability level, such as the complexity of the text, its subject matter, and the reader{'}s background knowledge. Generating summaries based on different readability levels is critical for enabling knowledge consumption by diverse audiences. However, current text generation approaches lack refined control, resulting in texts that are not customized to readers{'} proficiency levels. In this work, we bridge this gap and study techniques to generate summaries at specified readability levels. Unlike previous methods that focus on a specific readability level (e.g., lay summarization), we generate summaries with fine-grained control over their readability. We develop three text generation techniques for controlling readability: (1) instruction-based readability control, (2) reinforcement learning to minimize the gap between requested and observed readability and (3) a decoding approach that uses lookahead to estimate the readability of upcoming decoding steps. We show that our generation methods significantly improve readability control on news summarization (CNN/DM dataset), as measured by various readability metrics and human judgement, establishing strong baselines for controllable readability in summarization.\",\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fcontrollable-readability-summarization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-science%2Fcontrollable-readability-summarization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-science%2Fcontrollable-readability-summarization/lists"}