Selecting the Best Fit Software Programming Languages: Using BERT for File Format Detection - Xiong, Jize; Jiang, Chufeng; Zhao, Zhiming; Qiao, Yuxin; Zhang, Ning; Feng, Mingyang; Wang, Xiaosong (Journal of Theory and Practice of Engineering Science, 2024)
The detection and classification of programming languages and file formats are crucial in a variety of contexts, such as software analysis, code management, and cybersecurity. Despite significant research efforts, existing methods often struggle with the diversity and complexity of modern programming environments. This paper addresses these challenges by proposing a novel approach utilizing a BERT-based multi-class classification model to accurately classify input text into one of 21 programming languages. Our method leverages BERT’s advanced natural language processing capabilities to capture the intricate syntactic and semantic patterns of different programming languages, thereby enhancing detection accuracy and flexibility. We provide a comprehensive review of related work, highlighting existing approaches that include feature-based methods, structural and content-based techniques, and deep learning applications. While these methods have achieved notable success, they frequently lack generalizability and adaptability to new and evolving file types and languages. Our proposed BERT-based model addresses these limitations by offering a scalable and robust solution for programming language classification, demonstrating superior performance across diverse datasets. This research contributes to the field by providing a more versatile and accurate framework for programming language and file format detection, applicable to various real-world scenarios.