{"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/text-infilling","title":"Text Infilling","arxiv_id":"1901.00158","date":"2019-01-01","proceeding":null,"authors":["Wanrong Zhu","Zhiting Hu","Eric Xing"],"abstract":"Recent years have seen remarkable progress of text generation in different\ncontexts, such as the most common setting of generating text from scratch, and\nthe emerging paradigm of retrieval-and-rewriting. Text infilling, which fills\nmissing text portions of a sentence or paragraph, is also of numerous use in\nreal life, yet is under-explored. Previous work has focused on restricted\nsettings by either assuming single word per missing portion or limiting to a\nsingle missing portion to the end of the text. This paper studies the general\ntask of text infilling, where the input text can have an arbitrary number of\nportions to be filled, each of which may require an arbitrary unknown number of\ntokens. We study various approaches for the task, including a self-attention\nmodel with segment-aware position encoding and bidirectional context modeling.\nWe create extensive supervised data by masking out text with varying\nstrategies. Experiments show the self-attention model greatly outperforms\nothers, creating a strong baseline for future research.","url_abs":"http://arxiv.org/abs/1901.00158v2","url_pdf":"http://arxiv.org/pdf/1901.00158v2.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":"text-infilling","repo_url":"https://github.com/VegB/Text_Infilling","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"sentence","task_name":"Sentence"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"text-infilling","task_name":"Text Infilling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1901.00158","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1901.00158"}},"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/VegB/Text_Infilling","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"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":"b31f48e2429e5a6a","entry":"bleu_tokenize","repo":"VegB/Text_Infilling","repo_kind":"official","path":"text_infilling/bleu_tool.py","file_url":"https://github.com/VegB/Text_Infilling/blob/HEAD/text_infilling/bleu_tool.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b31f48e2429e5a6a"}},{"code_sha256_prefix":"e3c57c765b27f0ff","entry":"bleu_wrapper","repo":"VegB/Text_Infilling","repo_kind":"official","path":"text_infilling/bleu_tool.py","file_url":"https://github.com/VegB/Text_Infilling/blob/HEAD/text_infilling/bleu_tool.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e3c57c765b27f0ff"}},{"code_sha256_prefix":"dda226c5d7902119","entry":"compute_bleu","repo":"VegB/Text_Infilling","repo_kind":"official","path":"text_infilling/bleu_tool.py","file_url":"https://github.com/VegB/Text_Infilling/blob/HEAD/text_infilling/bleu_tool.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dda226c5d7902119"}},{"code_sha256_prefix":"3d7e583f31bdabd7","entry":"transform_input_with_is_missing_token","repo":"VegB/Text_Infilling","repo_kind":"official","path":"text_infilling/data_utils.py","file_url":"https://github.com/VegB/Text_Infilling/blob/HEAD/text_infilling/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3d7e583f31bdabd7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}