InfeRE: Step-by-Step Regex Generation via Chain of Inference

Shuai Zhang, Xiaodong Gu, Yuting Chen, Beijun Shen
8/8/2023
cs.AIcs.CL

No official code found. Best implementation: Smallqqqq/InfeRE (6 stars, last commit 2023-05-07).

Abstract

Automatically generating regular expressions (abbrev. regexes) from natural language description (NL2RE) has been an emerging research area. Prior studies treat regex as a linear sequence of tokens and generate the final expressions autoregressively in a single pass. They did not take into account the step-by-step internal text-matching processes behind the final results. This significantly hinders the efficacy and interpretability of regex generation by neural language models. In this paper, we propose a new paradigm called InfeRE, which decomposes the generation of regexes into chains of step-by-step inference. To enhance the robustness, we introduce a self-consistency decoding mechanism that ensembles multiple outputs sampled from different models. We evaluate InfeRE on two publicly available datasets, NL-RX-Turk and KB13, and compare the results with state-of-the-art approaches and the popular tree-based generation approach TRANX. Experimental results show that InfeRE substantially outperforms previous baselines, yielding 16.3% and 14.7% improvement in DFA@5 accuracy on two datasets, respectively. Particularly, InfeRE outperforms the popular tree-based generation approach by 18.1% and 11.3% on both datasets, respectively, in terms of DFA@5 accuracy.

View on arXivView PDF

Code Implementations(1)

Smallqqqq/InfeRECommunity100%

Step-by-step Regex Generation via Chain of Inference

61Shell, PythonJan 16, 20233 years ago

Similar Papers

Cite this paper

@article{zhang2023infere,
  title  = {InfeRE: Step-by-Step Regex Generation via Chain of Inference},
  author = {Shuai Zhang and Xiaodong Gu and Yuting Chen and Beijun Shen},
  year   = {2023},
  eprint = {2308.04041},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.04041v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.04041.svg)](https://codeofpaper.com/paper/2308.04041)

Discussion