arrow
返回

Syntax-aware on-the-fly code completion

delete2024-01-01
delete3
delete
OA
AI
W
Wannita Takerngsaksiri
C
Chakkrit Tantithamthavorn *
Y
Yuan-Fang Li
DOI:10.1016/j.infsof.2023.107336delete
delete原文链接
delete分享
delete收藏
查看原文
摘要

摘要

En 中文
Context: Code completion aims to help improve developers' productivity by suggesting the next code tokens from a given context. Various approaches have been proposed to incorporate abstract syntax tree (AST) information for model training, ensuring that code completion is aware of the syntax of the programming languages. However, existing syntax-aware code completion approaches are not on-the-fly, as we found that for every two-thirds of characters that developers type, AST fails to be extracted because it requires the syntactically correct source code, limiting its practicality in real-world scenarios. On the other hand, existing on-the-fly code completion does not consider syntactic information yet. Objective: In this paper, we propose PyCoder to leverage token types, a kind of lightweight syntactic information, which is readily available and aligns with the natural order of source code. Method: Our PyCoder is trained in a multi-task training manner so that by learning the supporting task of predicting token types during the training phase, the models achieve better performance on predicting tokens and lines of code without the need for token types in the inference phase. Results: Comprehensive experiments show that PyCoder achieves the first rank on the CodeXGLUE leaderboard with an accuracy of 77.12% for the token-level predictions, which is 0.43%-24.25% more accurate than baselines. In addition, PyCoder achieves an exact match of 43.37% for the line-level predictions, which is 3.63%-84.73% more accurate than baselines. Conclusions: These results lead us to conclude that token type information (an alternative to syntactic information) that is rarely used in the past can greatly improve the performance of code completion approaches, without requiring the syntactically correct source code like AST-based approaches do. Our PyCoder is publicly available on HuggingFace and GitHub.
Keyword:
Code completion
Multi-task learning
AI总结

AI总结

对已上传原文的论文进行重点信息的提取,主要内容包括:简要概述、研究摘要、背景介绍、关键亮点、图文解析、展望与总结。

期刊

Information and Software Technology 封面图
Information and Software Technology
IF:
4.3
论文数:
3.8K
被引数:
7.7K

机构

M
Monash University
学者数:
5.4W
论文数: 5.4W
被引数: 79
引用论文

引用论文

A unified multi-task learning model for AST-level and token-level code completion
err2022-04-18
err17
PREAI
errLiu, Fang; Li, Ge; Wei, Bolin; Xia, Xin; Fu, Zhiyi; Jin, Zhi
err分享
err收藏
Meta-analysis of bariatric surgery versus non-surgical treatment for type 2 diabetes mellitus
err2016-09-10
err0
errOAAI
errGuo-zhong Wu; Bing Cai; Feng Yu; Zheng Fang; Xing-li Fu; Hai-sen Zhou; Wen Zhang; Zhi-qiang Tian
err分享
err收藏
Comparison of sub‐ versus suprafascially raised anterolateral thigh free flaps with regard to donor‐site morbidity, function and aesthetics
err2017-11-20
err0
PREAI
errSebastian Fischer; Yannick Diehm; Christoph Hirche; Thomas Kremer; Adrien Daigeler; Ulrich Kneser; J. Frederick Hernekamp
err分享
err收藏
On the Naturalness of Software论软件的自然性
err2016-04-26
err164
PREAI
errHindle, Abram; Barr, Earl T.; Gabel, Mark; Su, Zhendong; Devanbu, Premkumar
err分享
err收藏
Understanding the Family Business
err
IF0
err2011-04-22
err0
PREAI
errKeanon Alderson
err分享
err收藏
Rapid Inflammation in Mice Lacking Both SOCS1 and SOCS3 in Hematopoietic Cells
err2016-09-01
err0
errOAAI
errTakashi Ushiki; Nicholas D. Huntington; Stefan P. Glaser; Hiu Kiu; Angela Georgiou; Jian-Guo Zhang; Donald Metcalf; Nicos A. Nicola; Andrew W. Roberts; Warren S. Alexander
err分享
err收藏
学者 查看更多内容