{"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/mermaid-metaphor-generation-with-symbolism","title":"MERMAID: Metaphor Generation with Symbolism and Discriminative Decoding","arxiv_id":"2103.06779","date":"2021-03-11","proceeding":"NAACL 2021 4","authors":["Tuhin Chakrabarty","Xurui Zhang","Smaranda Muresan","Nanyun Peng"],"abstract":"Generating metaphors is a challenging task as it requires a proper understanding of abstract concepts, making connections between unrelated concepts, and deviating from the literal meaning. In this paper, we aim to generate a metaphoric sentence given a literal expression by replacing relevant verbs. Based on a theoretically-grounded connection between metaphors and symbols, we propose a method to automatically construct a parallel corpus by transforming a large number of metaphorical sentences from the Gutenberg Poetry corpus (Jacobs, 2018) to their literal counterpart using recent advances in masked language modeling coupled with commonsense inference. For the generation task, we incorporate a metaphor discriminator to guide the decoding of a sequence to sequence model fine-tuned on our parallel data to generate high-quality metaphors. Human evaluation on an independent test set of literal statements shows that our best model generates metaphors better than three well-crafted baselines 66% of the time on average. A task-based evaluation shows that human-written poems enhanced with metaphors proposed by our model are preferred 68% of the time compared to poems without metaphors.","url_abs":"https://arxiv.org/abs/2103.06779v2","url_pdf":"https://arxiv.org/pdf/2103.06779v2.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":"mermaid-metaphor-generation-with-symbolism","repo_url":"https://github.com/tuhinjubcse/MetaphorGenNAACL2021","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"masked-language-modeling","task_name":"Masked Language Modeling"},{"task_slug":"sentence","task_name":"Sentence"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2103.06779","atlas_url":"https://app.syntology.ai/?focus=2103.06779","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2103.06779"}},"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/tuhinjubcse/MetaphorGenNAACL2021","reach":null}],"summary":{"unverified":2},"by_repo_kind":{"official":{"samples":2,"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":2,"samples":[{"code_sha256_prefix":"84b7d42451b10778","entry":"convert_to_word","repo":"tuhinjubcse/MetaphorGenNAACL2021","repo_kind":"official","path":"fairseq/fairseq/commonsense_generator.py","file_url":"https://github.com/tuhinjubcse/MetaphorGenNAACL2021/blob/HEAD/fairseq/fairseq/commonsense_generator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"84b7d42451b10778"}},{"code_sha256_prefix":"ed53411db992a513","entry":"generate_next_word","repo":"tuhinjubcse/MetaphorGenNAACL2021","repo_kind":"official","path":"fairseq/fairseq/commonsense_generator.py","file_url":"https://github.com/tuhinjubcse/MetaphorGenNAACL2021/blob/HEAD/fairseq/fairseq/commonsense_generator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed53411db992a513"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}