{"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/r-3-reverse-retrieve-and-rank-for-sarcasm","title":"$R^3$: Reverse, Retrieve, and Rank for Sarcasm Generation with Commonsense Knowledge","arxiv_id":"2004.13248","date":"2020-04-28","proceeding":null,"authors":["Tuhin Chakrabarty","Debanjan Ghosh","Smaranda Muresan","Nanyun Peng"],"abstract":"We propose an unsupervised approach for sarcasm generation based on a non-sarcastic input sentence. Our method employs a retrieve-and-edit framework to instantiate two major characteristics of sarcasm: reversal of valence and semantic incongruity with the context which could include shared commonsense or world knowledge between the speaker and the listener. While prior works on sarcasm generation predominantly focus on context incongruity, we show that combining valence reversal and semantic incongruity based on the commonsense knowledge generates sarcasm of higher quality. Human evaluation shows that our system generates sarcasm better than human annotators 34% of the time, and better than a reinforced hybrid baseline 90% of the time.","url_abs":"https://arxiv.org/abs/2004.13248v4","url_pdf":"https://arxiv.org/pdf/2004.13248v4.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":"r-3-reverse-retrieve-and-rank-for-sarcasm","repo_url":"https://github.com/ying09/TextFuseNet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"scene-text-detection","task_name":"Scene Text Detection"},{"task_slug":"sentence","task_name":"Sentence"},{"task_slug":"world-knowledge","task_name":"World Knowledge"}],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2004.13248","atlas_url":"https://app.syntology.ai/?focus=2004.13248","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.13248"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/ying09/TextFuseNet","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":3},"by_repo_kind":{"listed":{"samples":9,"ran":6,"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":"0df9d3b583fbc6cb","entry":"batched_nms","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/nms.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/nms.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0df9d3b583fbc6cb"}},{"code_sha256_prefix":"dd81247228bb9b05","entry":"compute_polygon_area","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"demo/ctw1500_detection.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/demo/ctw1500_detection.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd81247228bb9b05"}},{"code_sha256_prefix":"e8526a516b4f9206","entry":"convert_basic_c2_names","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/checkpoint/c2_model_loading.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/checkpoint/c2_model_loading.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e8526a516b4f9206"}},{"code_sha256_prefix":"52810b504f0d1066","entry":"convert_c2_detectron_names","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/checkpoint/c2_model_loading.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/checkpoint/c2_model_loading.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"52810b504f0d1066"}},{"code_sha256_prefix":"406f84cf799ed34d","entry":"pad_masks","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/mask_ops.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/mask_ops.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"406f84cf799ed34d"}},{"code_sha256_prefix":"d03592674030077f","entry":"paste_mask_in_image_old","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/mask_ops.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/mask_ops.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d03592674030077f"}},{"code_sha256_prefix":"4845964b76bba6c5","entry":"batched_nms_rotated","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/nms.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/nms.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":"4845964b76bba6c5"}},{"code_sha256_prefix":"d3fa37a000ad294d","entry":"nms_rotated","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/nms.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/nms.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":"d3fa37a000ad294d"}},{"code_sha256_prefix":"f74abd7e1355f8cd","entry":"paste_masks_in_image","repo":"ying09/TextFuseNet","repo_kind":"listed","path":"detectron2/layers/mask_ops.py","file_url":"https://github.com/ying09/TextFuseNet/blob/HEAD/detectron2/layers/mask_ops.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":"f74abd7e1355f8cd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}