Structural Syntax Network for Code Classification
Preprint
- 12 December 2023
- preprint
- Published by MDPI AG in Preprints.org
Abstract
The field of program classification, a critical aspect of software engineering, facilitates understanding and categorization of code across various applications, including anomaly detection, and code quality assessment. The advancement of cross-language program classification opens up avenues for efficient code translation among different programming languages, significantly aiding developers in rapid coding and reducing development cycles. Existing research primarily focuses on semantic code analysis, with limited emphasis on cross-linguistic challenges. To address this, we introduce an innovative neural network model, CodeSemanticsNN, which leverages a refined Syntax Structure (SS) approach. This model consists of two integral mechanisms: first, it adopts a novel SS representation that combines sequential and graph-based SS structures, enhancing semantic feature capture. Second, it employs a 'unified vocabulary' strategy to bridge the gap between diverse programming languages, facilitating efficient cross-language classification. Additionally, we have compiled a comprehensive dataset of 20,000 files spanning five programming languages, serving as a benchmark for cross-language classification. Our experiments on this dataset demonstrate that CodeSemanticsNN surpasses existing models in four key metrics: Precision, Recall, F1-score, and Accuracy.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- Exploration of Convolutional Neural Network models for source code classificationEngineering Applications of Artificial Intelligence, 2021
- Boundaries and edges rethinking: An end-to-end neural model for overlapping entity relation extractionInformation Processing & Management, 2020
- Enriching contextualized language model from knowledge graph for biomedical information extractionBriefings in Bioinformatics, 2020
- Code smell severity classification using machine learning techniquesKnowledge-Based Systems, 2017
- Recognizing Algorithms Using Language Constructs, Software Metrics and Roles of Variables: An Experiment with Sorting AlgorithmsThe Computer Journal, 2010
- The Graph Neural Network ModelIEEE Transactions on Neural Networks, 2008
- Comparison and Evaluation of Clone Detection ToolsIEEE Transactions on Software Engineering, 2007
- Bayesian Network ClassifiersMachine Learning, 1997
- Induction of decision treesMachine Learning, 1986
- Algorithm classification through synthesisThe Computer Journal, 1980