论文标题

ASTBERT:使用抽象语法树启用用于财务代码理解的语言模型

AstBERT: Enabling Language Model for Financial Code Understanding with Abstract Syntax Trees

论文作者

Liang, Rong, Zhang, Tiehua, Lu, Yujie, Liu, Yuze, Huang, Zhen, Chen, Xin

论文摘要

使用预先训练的语言模型来了解源代码,由于遇到财务风险的巨大潜力,金融机构引起了越来越多的关注。但是,应用这些语言模型直接解决与语言相关的问题存在一些挑战。例如,自然语言(NL)和编程语言(PL)之间域知识的转移需要从不同角度从数据中理解语义和句法信息。为此,我们提出了Astbert模型,这是一种预先培训的PL模型,旨在更好地使用抽象语法树(AST)更好地了解财务代码。具体来说,我们从Aripay代码存储库中收集了庞大的源代码(Java和Python),并通过代码解析器的帮助将句法和语义代码知识纳入我们的模型,其中可以解释和集成源代码的AST信息。我们在三个任务上评估了拟议模型的性能,包括代码问题回答,代码克隆检测和代码改进。实验结果表明,我们的阿斯特伯特在三个不同的下游任务上实现了有希望的表现。

Using the pre-trained language models to understand source codes has attracted increasing attention from financial institutions owing to the great potential to uncover financial risks. However, there are several challenges in applying these language models to solve programming language-related problems directly. For instance, the shift of domain knowledge between natural language (NL) and programming language (PL) requires understanding the semantic and syntactic information from the data from different perspectives. To this end, we propose the AstBERT model, a pre-trained PL model aiming to better understand the financial codes using the abstract syntax tree (AST). Specifically, we collect a sheer number of source codes (both Java and Python) from the Alipay code repository and incorporate both syntactic and semantic code knowledge into our model through the help of code parsers, in which AST information of the source codes can be interpreted and integrated. We evaluate the performance of the proposed model on three tasks, including code question answering, code clone detection and code refinement. Experiment results show that our AstBERT achieves promising performance on three different downstream tasks.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源