gMeta:基于模板的正则表达式生成算法
gMeta: Template-based Regular Expression Generation over Noisy Examples
摘要:
正则表达式(regex)广泛用于计算机科学的不同领域,例如程序设计语言、字符串处理和数据库。然而,现有的合成或修复正则表达式的工具总是假设输入的例子是完美的。在实际的工业场景中,这种假设并不完全成立。因此,本文提出了一种简单但有效的基于模板的方法来生成正则表达式噪声的例子。具体地,我们提出了一个数据模型(即,MetaParam)来提取字符串的特征以聚类所有示例。然后,我们提出了一个实用的动态阈值方案,通过检测CDF图上的拐点来过滤出异常的例子。最后,我们设计了一个基于模板的算法,将有限个正例转换为正则表达式,该算法高效、可解释且可扩展。我们对应用于真实世界数据集的四种不同的提取任务进行了实验评估,并在F-测度方面获得了令人满意的结果。此外,gMeta在实际工业场景中取得了优异的效果。
英文摘要:
Regular expressions (regexes) are widely used in different fields of computer science, such as programming languages, string processing, and databases. However, existing tools for synthesizing or repairing regexes always assume that the input examples are faultless. In real industrial scenarios, this assumption does not entirely hold. Thus, this paper presents a simple but effective templated-based approach to generate regular expressions over noisy examples. Specifically, we present a data model (i.e., MetaParam) to extract features of strings for clustering all examples. Then, we propose a practical dynamic thresholding scheme to filter out anomalous examples via detecting knee points on CDF graphs. Finally, we design a template-based algorithm to translate a finite of positve examples to regular expression, which is efficient, interpretable, and extensible. We performed an experimental evaluation on four different extraction tasks applied to real-world datasets and obtained promising results in terms of F-measure. Moreover, gMeta achieves excellent results in real industrial scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。