RegexExplainer: Automatic Description Generation for Regular Expressions via Transformer

Regular expressions can describe specific matching rules, which can be used to determine the string format or extract the string content. Until now, regular expressions have been widely used in various operating systems and have been supported by most programming languages. However, the understanding of regular expressions is challenging for end-users or developers, who may not familiar with the syntax of regular expressions. Therefore, it is pressing for researchers to put forward effective methods to automatically generate functional descriptions for regular expressions. In this study, we formalize the description generation of the regular expression as a neural machine translation task. Then we propose a fully data-driven method RegexExplainer based on Transformer. Specifically, it uses Regex Encoder and AST Encoder to jointly learn the encoding information of regular expressions. In order to confirm the effectiveness of RegexExplainer, we build a high-quality corpus that consists of 107,851 pairs of regular expressions along with their corresponding descriptions. The final experimental results demonstrate that RegexExplainer is able to attain better performance compared to the state-of-the-art baselines when it comes to three performance measures.

Authors

Institutions

Publication Details

Published
2024-12-27
DOI
https://doi.org/10.1109/icctit64404.2024.10928415
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

RegexExplainer: Automatic Description Generation for Regular Expressions via Transformer

Tianyue Liu, Shanshan Cao, Xiao Yang, Guang Yang et al.
Natural Language Processing Techniques
article

RegexExplainer: Automatic Description Generation for Regular Expressions via Transformer

Tianyue Liu, Shanshan Cao, Xiao Yang, Guang Yang, Yun Wu
article en

Abstract

Regular expressions can describe specific matching rules, which can be used to determine the string format or extract the string content. Until now, regular expressions have been widely used in various operating systems and have been supported by most programming languages. However, the understanding of regular expressions is challenging for end-users or developers, who may not familiar with the syntax of regular expressions. Therefore, it is pressing for researchers to put forward effective methods to automatically generate functional descriptions for regular expressions. In this study, we formalize the description generation of the regular expression as a neural machine translation task. Then we propose a fully data-driven method RegexExplainer based on Transformer. Specifically, it uses Regex Encoder and AST Encoder to jointly learn the encoding information of regular expressions. In order to confirm the effectiveness of RegexExplainer, we build a high-quality corpus that consists of 107,851 pairs of regular expressions along with their corresponding descriptions. The final experimental results demonstrate that RegexExplainer is able to attain better performance compared to the state-of-the-art baselines when it comes to three performance measures.

Minzu University of China (CN), Wuhan University (CN), Wuhan University of Engineering Science, Nanjing University of Aeronautics and Astronautics (CN)
Hubei Provincial Department of Education
Affordable and clean energy
Openalex Percentile: Top 74%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

RegexExplainer: Automatic Description Generation for Regular Expressions via Transformer — Tianyue Liu, Shanshan Cao, et al. · (2024) | TGRS Research Map | TGRS