Data Extraction via Semantic Regular Expression Synthesis
Qiaochu Chen, Arko Banerjee, Çagatay Demiralp, Greg Durrett, Isil Dillig
Abstract
Many data extraction tasks of practical relevance require not only syntactic pattern matching but also semantic reasoning about the content of the underlying text. While regular expressions are very well suited for tasks that require only syntactic pattern matching, they fall short for data extraction tasks that involve both a syntactic and semantic component. To address this issue, we introduce semantic regexes, a generalization of regular expressions that facilitates combined syntactic and semantic reasoning about textual data. We also propose a novel learning algorithm that can synthesize semantic regexes from a small number of positive and negative examples. Our proposed learning algorithm uses a combination of neural sketch generation and compositional type-directed synthesis for fast and effective generalization from a small number of examples. We have implemented these ideas in a new tool called Smore and evaluated it on representative data extraction tasks involving several textual datasets. Our evaluation shows that semantic regexes can better support complex data extraction tasks than standard regular expressions and that our learning algorithm significantly outperforms existing tools, including state-of-the-art neural networks and program synthesis tools.
- Work started and partially completed at Sigma Computing.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4414d90a-d35a-4ba4-b90d-2beb5ae08130Cited by top-tier papers8
- PhotoScout: Synthesis-Powered Multi-Modal Image SearchCeleste Barnaby, Qiaochu Chen, Chenglong Wang, Isil DilligCHI 2024 · 9 citations
- Optimal Program Synthesis via Abstract InterpretationStephen Mell, Steve Zdancewic, Osbert BastaniPOPL 2024 · 6 citations
- From Batch to Stream: Automatic Generation of Online AlgorithmsZiteng Wang, Shankara Pailoor, Aaryan Prakash, Yuepeng Wang et al.PLDI 2024 · 4 citations
- StructVizor: Interactive Profiling of Semi-Structured Textual DataYanwei Huang, Yan Miao, Di Weng, Adam Perer et al.CHI 2025 · 3 citations
- Membership Testing for Semantic Regular ExpressionsYifei Huang, Matin Amini, Alexis Le Glaunec, Konstantinos Mamouras et al.PLDI 2025
Builds on16
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
- Synchromesh: Reliable Code Generation from Pre-trained Language ModelsGabriel Poesia, Alex Polozov, Vu Le, Ashish Tiwari et al.ICLR 2022 · 200 citations
- Jigsaw: Large Language Models meet Program SynthesisNaman Jain, Skanda Vaidyanath, Arun Iyer, Nagarajan Natarajan et al.ICSE 2022 · 134 citations
- Multi-modal synthesis of regular expressionsQiaochu Chen, Xinyu Wang, Xi Ye, Greg Durrett et al.PLDI 2020 · 81 citations
Related papers
- Repairing Regular Expressions for ExtractionNariyoshi Chida, Tachio TerauchiPLDI 2023 · 9 citations
- TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-RepairYeting Li, Shuaimin Li, Zhiwu Xu, Jialun Cao et al.ICSE 2021 · 16 citations
- Neuralizing Regular Expressions for Slot FillingChengyue Jiang, Zijian Jin, Kewei TuEMNLP 2021
- Benchmarking Multimodal Regex Synthesis with Complex StructuresXi Ye, Qiaochu Chen, Isil Dillig, Greg DurrettACL 2020 · 13 citations
- Grammar Filtering for Syntax-Guided SynthesisKairo Morton, William T. Hallahan, Elven Shum, Ruzica Piskac et al.AAAI 2020 · 12 citations
