Source Code Similarity Detection Using NLP Techniques
摘要
In recent years, plagiarism in programming assignments and excessive code reuse in software development have become pressing concerns for both academia and the IT industry. Traditional text-matching tools often fail to identify copied programs when developers or students disguise them by altering variable names, rearranging code segments, or modifying formatting. This paper presents a web-based system designed to detect source code similarity by integrating structural analysis with Natural Language Processing (NLP) techniques. The proposed model evaluates code resemblance using multiple approaches, such as sequence-based (Difflib), vector-based (Cosine Similarity), token-based (Jaccard Index), and structure-based (Abstract Syntax Tree) methods. Among these, the AST-based technique stands out by focusing on the syntactic and structural patterns of code rather than its surface-level text. Experimental results demonstrate that this approach provides higher reliability and accuracy, especially when identifying refactored or slightly modified code segments.