Evaluating the Impact of Source Code Parsers on ML4SE Models
Not on the map. Why?
Abstract (arXiv)
As researchers and practitioners apply Machine Learning to increasingly more software engineering problems, the approaches they use become more sophisticated. A lot of modern approaches utilize internal code structure in the form of an abstract syntax tree (AST) or its extensions: path-based representation, complex graph combining AST with additional edges. Even though the process of extracting ASTs from code can be done with different parsers, the impact of choosing a parser on the final model quality remains unstudied. Moreover, researchers often omit the exact details of extracting particular code representations. In this work, we evaluate two models, namely Code2Seq and TreeLSTM, in the method name prediction task backed by eight different parsers for the Java language. To unify the process of data preparation with different parsers, we develop SuperParser, a multi-language parser-agnostic library based on PathMiner. SuperParser facilitates the end-to-end creation of datasets suitable for training and evaluation of ML models that work with structural information from source code. Our results demonstrate that trees built by different parsers vary in their structure and content. We then analyze how this diversity affects the models' quality and show that the quality gap between the most and least suitable parsers for both models turns out to be significant. Finally, we discuss other features of the parsers that researchers and practitioners should take into account when selecting a parser along with the impact on the models' quality. The code of SuperParser is publicly available at https://doi.org/10.5281/zenodo.6366591. We also publish Java-norm, the dataset we use to evaluate the models: https://doi.org/10.5281/zenodo.6366599.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 18 of its 50 references that are in the map. First posted on arXiv 17 Jun 2022.
Builds on
18 of 50 references.
References · 18
- 2017Attention Is All You Needcited by 60,361
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2017Learning to Represent Programs with Graphscited by 220
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
- 2018Tree-to-tree Neural Networks for Program Translationcited by 93
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2019Code Generation as a Dual Task of Code Summarizationcited by 62
- 2018Structured Neural Summarizationcited by 54
- 2018Nopol: Automatic Repair of Conditional Statement Bugs in Java Programscited by 32
6 more
- 2018A General Path-Based Representation for Predicting Program Propertiescited by 29
- 2020Typilus: Neural Type Hintscited by 29
- 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 24
- 2021PSIMiner: A Tool for Mining Rich Abstract Syntax Trees from Codecited by 4
- 2018AST-Based Deep Learning for Detecting Malicious PowerShellcited by 3
Built on by
Citing papers per year: 2023: 1.
1 paper.