SG-Coder: Code completion algorithm applied on large software development platform
Shan Li, Zesan Liu, Xinyi Liu, Gang Chen, Ying Gao, Yaqi Liu · 2023
Existing general-purpose code models have achieved great accomplishments in code understanding, code generation, comment generation, code completion and other code intelligent fields. However, how code models can update and learn based on the code written in their own projects, in order to enhance their customizability and support developers working on specific domains or using specific frameworks, has become a research problem that needs to be addressed. Based on the SG-UAP (State-Grid unified application platform), a large-scale software development platform used by over 120 projects in State-Grid Corporation, we proposes a code completion algorithm called SG-Coder, by leveraging adaptive tokenizer, pretrained models, and discriminator, the algorithm addresses issues such as inconsistent technology stacks, inconsistent code styles, and different code comment languages between specific code repositories and publicly available code repositories on GitHub or other development framework. Through experimental verification, the code completion tool developed based on our SG-Coder algorithm has demonstrated good practicality on both public datasets and the SG-UAP platform-specific datasets. It can significantly enhance the work efficiency of developers, enhance code quality, promote knowledge sharing and reuses.