{"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-transport-toward-learning-causal-effects","title":"Text-Transport: Toward Learning Causal Effects of Natural Language","arxiv_id":"2310.20697","date":"2023-10-31","proceeding":null,"authors":["Victoria Lin","Louis-Philippe Morency","Eli Ben-Michael"],"abstract":"As language technologies gain prominence in real-world settings, it is important to understand how changes to language affect reader perceptions. This can be formalized as the causal effect of varying a linguistic attribute (e.g., sentiment) on a reader's response to the text. In this paper, we introduce Text-Transport, a method for estimation of causal effects from natural language under any text distribution. Current approaches for valid causal effect estimation require strong assumptions about the data, meaning the data from which one can estimate valid causal effects often is not representative of the actual target domain of interest. To address this issue, we leverage the notion of distribution shift to describe an estimator that transports causal effects between domains, bypassing the need for strong assumptions in the target domain. We derive statistical guarantees on the uncertainty of this estimator, and we report empirical results and analyses that support the validity of Text-Transport across data settings. Finally, we use Text-Transport to study a realistic setting--hate speech on social media--in which causal effects do shift significantly between text domains, demonstrating the necessity of transport when conducting causal inference on natural language.","url_abs":"https://arxiv.org/abs/2310.20697v1","url_pdf":"https://arxiv.org/pdf/2310.20697v1.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-transport-toward-learning-causal-effects","repo_url":"https://github.com/torylin/text-transport","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"attribute","task_name":"Attribute"},{"task_slug":"causal-inference","task_name":"Causal Inference"},{"task_slug":null,"task_name":"valid"}],"methods":[{"method_slug":"causal-inference","method_name":"Causal inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.20697","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.20697"}},"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/torylin/text-transport","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":2},"by_repo_kind":{"official":{"samples":8,"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":8,"samples":[{"code_sha256_prefix":"c38c8c2ea3432d51","entry":"add_prefix","repo":"torylin/text-transport","repo_kind":"official","path":"code/openai_classification.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/openai_classification.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c38c8c2ea3432d51"}},{"code_sha256_prefix":"bfc6ed7f407ced83","entry":"eliminate_dups","repo":"torylin/text-transport","repo_kind":"official","path":"code/generate_randomization_corpus.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/generate_randomization_corpus.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bfc6ed7f407ced83"}},{"code_sha256_prefix":"829e8cce913d9815","entry":"getDF","repo":"torylin/text-transport","repo_kind":"official","path":"code/process_amazon_data.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/process_amazon_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"829e8cce913d9815"}},{"code_sha256_prefix":"262b55b0b9f742ff","entry":"get_prob_clm","repo":"torylin/text-transport","repo_kind":"official","path":"code/estimate.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/estimate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"262b55b0b9f742ff"}},{"code_sha256_prefix":"83d6ac4ce867348d","entry":"get_prob_mlm","repo":"torylin/text-transport","repo_kind":"official","path":"code/estimate.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/estimate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"83d6ac4ce867348d"}},{"code_sha256_prefix":"f062e594c6f41912","entry":"preprocess","repo":"torylin/text-transport","repo_kind":"official","path":"code/finetune.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/finetune.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f062e594c6f41912"}},{"code_sha256_prefix":"8b6ef2cf5081fcf4","entry":"get_num_tokens","repo":"torylin/text-transport","repo_kind":"official","path":"code/openai_classification.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/openai_classification.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":"8b6ef2cf5081fcf4"}},{"code_sha256_prefix":"c63d2ec7cd83721c","entry":"get_sent_groups","repo":"torylin/text-transport","repo_kind":"official","path":"code/process_speeches.py","file_url":"https://github.com/torylin/text-transport/blob/HEAD/code/process_speeches.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":"c63d2ec7cd83721c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}