Lune

OOPSLA2023Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Membership Testing for Semantic Regular Expressions cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis cites Language Models are Few-Shot Learners
  • Jigsaw: Large Language Models meet Program Synthesis cites Multi-modal synthesis of regular expressions
  • Jigsaw: Large Language Models meet Program Synthesis cites Language Models are Few-Shot Learners
  • PhotoScout: Synthesis-Powered Multi-Modal Image Search cites Language Models are Few-Shot Learners
  • Synchromesh: Reliable Code Generation from Pre-trained Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. PhotoScout: Synthesis-Powered Multi-Modal Image SearchCeleste Barnaby, Qiaochu Chen, Chenglong Wang, Isil DilligCHI 2024 · 9 citations
  2. Optimal Program Synthesis via Abstract InterpretationStephen Mell, Steve Zdancewic, Osbert BastaniPOPL 2024 · 6 citations
  3. From Batch to Stream: Automatic Generation of Online AlgorithmsZiteng Wang, Shankara Pailoor, Aaryan Prakash, Yuepeng Wang et al.PLDI 2024 · 4 citations
  4. StructVizor: Interactive Profiling of Semi-Structured Textual DataYanwei Huang, Yan Miao, Di Weng, Adam Perer et al.CHI 2025 · 3 citations
  5. Membership Testing for Semantic Regular ExpressionsYifei Huang, Matin Amini, Alexis Le Glaunec, Konstantinos Mamouras et al.PLDI 2025

Builds on17

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. 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
  3. Synchromesh: Reliable Code Generation from Pre-trained Language ModelsGabriel Poesia, Alex Polozov, Vu Le, Ashish Tiwari et al.ICLR 2022 · 200 citations
  4. Jigsaw: Large Language Models meet Program SynthesisNaman Jain, Skanda Vaidyanath, Arun Iyer, Nagarajan Natarajan et al.ICSE 2022 · 134 citations
  5. Multi-modal synthesis of regular expressionsQiaochu Chen, Xinyu Wang, Xi Ye, Greg Durrett et al.PLDI 2020 · 81 citations

Related papers

  1. Repairing Regular Expressions for ExtractionNariyoshi Chida, Tachio TerauchiPLDI 2023 · 9 citations
  2. TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-RepairYeting Li, Shuaimin Li, Zhiwu Xu, Jialun Cao et al.ICSE 2021 · 16 citations
  3. Learning Algebraic Recombination for Compositional GeneralizationChenyao Liu, Shengnan An, Zeqi Lin, Qian Liu et al.ACL Findings 2021 · 22 citations
  4. Few-Shot Novel Concept Learning for Semantic ParsingSoham Dan, Osbert Bastani, Dan RothEMNLP Findings 2021 · 1 citation
  5. Neuralizing Regular Expressions for Slot FillingChengyue Jiang, Zijian Jin, Kewei TuEMNLP 2021
Dusk over the sea between two cliffs drawn in fine vertical lines