SoftRegex: Generating Regex from Natural Language Descriptions using Softened Regex Equivalence
We continue the study of generating se-mantically correct regular expressions from natural language descriptions (NL). The current state-of-the-art model SemRegex produces regular expressions from NLs by rewarding the reinforced learning based on the semantic (rather than syntactic) equivalence between two regular expressions. Since the regular expression equivalence problem is PSPACE-complete, we introduce the EQ{\_}Reg model for computing the simi-larity of two regular expressions using deep neural networks. Our EQ{\_}Reg mod-el essentially softens the equivalence of two regular expressions when used as a reward function. We then propose a new regex generation model, SoftRegex, us-ing the EQ{\_}Reg model, and empirically demonstrate that SoftRegex substantially reduces the training time (by a factor of at least 3.6) and produces state-of-the-art results on three benchmark datasets.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Semantic Regexes: Auto-Interpreting LLM Features with a Structured Language
Automated interpretability aims to translate large language model (LLM) features into human understandable descriptions. However, natural language feature descriptions can be vague, inconsistent, and require manual relab…
Benchmarking Multimodal Regex Synthesis with Complex Structures
Existing datasets for regular expression (regex) generation from natural language are limited in complexity; compared to regex tasks that users post on StackOverflow, the regexes in these datasets are simple, and the lan…
BenchmarkingSketch-Driven Regular Expression Generation from Natural Language and Examples
Recent systems for converting natural language descriptions into regular expressions (regexes) have achieved some success, but typically deal with short, formulaic text and can only produce simple regexes. Realworld rege…
SemRegex: A Semantics-Based Approach for Generating Regular Expressions from Natural Language Specifications
Recent research proposes syntax-based approaches to address the problem of generating programs from natural language specifications. These approaches typically train a sequence-to-sequence learning model using a syntax-b…
Program SynthesisInfeRE: Step-by-Step Regex Generation via Chain of Inference
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…
Text Matching