{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/delete-retrieve-generate-a-simple-approach-to","title":"Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer","arxiv_id":"1804.06437","date":"2018-04-17","proceeding":"NAACL 2018 6","authors":["Juncen Li","Robin Jia","He He","Percy Liang"],"abstract":"We consider the task of text attribute transfer: transforming a sentence to\nalter a specific attribute (e.g., sentiment) while preserving its\nattribute-independent content (e.g., changing \"screen is just the right size\"\nto \"screen is too small\"). Our training data includes only sentences labeled\nwith their attribute (e.g., positive or negative), but not pairs of sentences\nthat differ only in their attributes, so we must learn to disentangle\nattributes from attribute-independent content in an unsupervised way. Previous\nwork using adversarial methods has struggled to produce high-quality outputs.\nIn this paper, we propose simpler methods motivated by the observation that\ntext attributes are often marked by distinctive phrases (e.g., \"too small\").\nOur strongest method extracts content words by deleting phrases associated with\nthe sentence's original attribute value, retrieves new phrases associated with\nthe target attribute, and uses a neural model to fluently combine these into a\nfinal output. On human evaluation, our best method generates grammatical and\nappropriate responses on 22% more inputs than the best previous system,\naveraged over three attribute transfer datasets: altering sentiment of reviews\non Yelp, altering sentiment of reviews on Amazon, and altering image captions\nto be more romantic or humorous.","url_abs":"http://arxiv.org/abs/1804.06437v1","url_pdf":"http://arxiv.org/pdf/1804.06437v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://github.com/lijuncen/Sentiment-and-Style-Transfer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://worksheets.codalab.org/worksheets/0xe3eb416773ed4883bb737662b31b4948","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":null},{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://github.com/davidgolub/charizard","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://github.com/prithivirajdamodaran/styleformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://github.com/realmichaelye/NLP-State-of-the-art-Style-Transfer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"delete-retrieve-generate-a-simple-approach-to","repo_url":"https://github.com/rpryzant/delete_retrieve_generate","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"image-captioning","task_name":"Image Captioning"},{"task_slug":"sentence","task_name":"Sentence"},{"task_slug":"style-transfer","task_name":"Style Transfer"},{"task_slug":"text-attribute-transfer","task_name":"Text Attribute Transfer"},{"task_slug":"unsupervised-text-style-transfer","task_name":"Unsupervised Text Style Transfer"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/text-style-transfer-on-yelp-review-dataset","task":"Text Style Transfer","dataset":"Yelp Review Dataset (Small)","model":"DeleteAndRetrieve","rank_in_archive_order":4,"of":8,"metrics":{"G-Score (BLEU, Accuracy)":"54.64"},"uses_additional_data":false},{"leaderboard":"/sota/text-style-transfer-on-yelp-review-dataset","task":"Text Style Transfer","dataset":"Yelp Review Dataset (Small)","model":"DeleteOnly","rank_in_archive_order":5,"of":8,"metrics":{"G-Score (BLEU, Accuracy)":"54.11"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1804.06437","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1804.06437"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rpryzant/delete_retrieve_generate","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/prithivirajdamodaran/styleformer","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lijuncen/Sentiment-and-Style-Transfer","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/davidgolub/charizard","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/realmichaelye/NLP-State-of-the-art-Style-Transfer","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://worksheets.codalab.org/worksheets/0xe3eb416773ed4883bb737662b31b4948","reach":null}],"summary":{"unverified":8},"by_repo_kind":{"listed":{"samples":8,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"dc7c732b212737d8","entry":"attempt_load_model","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/models.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc7c732b212737d8"}},{"code_sha256_prefix":"434a3b59116b43ca","entry":"bleu","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/evaluation.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"434a3b59116b43ca"}},{"code_sha256_prefix":"252df772e15e30a2","entry":"bleu_stats","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/evaluation.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"252df772e15e30a2"}},{"code_sha256_prefix":"75a5c5c12355b9eb","entry":"build_vocab_maps","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/data.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"75a5c5c12355b9eb"}},{"code_sha256_prefix":"02b6172688f524db","entry":"extract_attributes","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/data.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"02b6172688f524db"}},{"code_sha256_prefix":"faa637162315c832","entry":"get_bleu","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/evaluation.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"faa637162315c832"}},{"code_sha256_prefix":"141219cec6bf7fb1","entry":"get_latest_ckpt","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/models.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"141219cec6bf7fb1"}},{"code_sha256_prefix":"49b59cc9949d9fda","entry":"read_nmt_data","repo":"rpryzant/delete_retrieve_generate","repo_kind":"listed","path":"src/data.py","file_url":"https://github.com/rpryzant/delete_retrieve_generate/blob/HEAD/src/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"49b59cc9949d9fda"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}