Deprecated: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 in /home/u483256323/domains/poorvam.com/public_html/subdomains/pore/includes/api.php on line 184
Back to Search View Original Cite This Article

Abstract

<jats:p>Разработано представление исходного кода в виде бинарных векторов на основе хеширования поддеревьев абстрактного синтаксического дерева (AST). Предлагаемый подход позволяет выявлять структурные сходства и различия между фрагментами программ за счет перехода к количественным метрикам, что упрощает решение задач сравнения версий, поиска дубликатов и обнаружения плагиата. В рамках исследования создано расширенное представление AST с возможностью аннотирования узлов метаданными и реализован рекурсивный алгоритм хеширования с фильтрацией полей, не влияющих на структуру управления. На основе полученных хеш-значений сформированы бинарные векторы фиксированной размерности, которые после исключения редких признаков и преобразования в разреженный формат использованы в качестве входных данных для классификатора Random Forest. Экспериментальная валидация проведена на наборе данных Python75 с решениями 75 задач. Точность классификации типа решаемой задачи по исходному коду достигла 89.8 %, что подтверждает практическую пригодность разработанного метода для задач анализа программного кода с применением методов машинного обучения.</jats:p> <jats:p>This paper proposes an approach to source code analysis based on identifying recurring fragments of abstract syntax trees (ASTs) in Python programs. The aim is to transform code into a compact vector representation suitable for machine learning tasks. The proposed method involves hashing AST fragments while considering control flow structures and external function calls. An extended AST representation is developed, augmenting the standard Python AST module with metadata such as subtree hash codes. Based on the obtained hashes and their occurrences, a binarized bag-ofwords (BoW) vector representation of the source code is constructed. Experimental validation was conducted on the Python75 dataset, containing over 200 000 source code files across 75 programming tasks. Using the binary vectors as input, a Random Forest classifier achieved a classification accuracy of 89.8 %. The transformation to sparse binary matrices significantly reduced memory requirements while maintaining high performance. The key contributions include a specialized hashing algorithm and an effective code vectorization method based on binary bag-of-words. The approach demonstrates practical value by enabling efficient code analysis with low memory overhead and high accuracy, opening up possibilities for applications in code classification and similar code search.</jats:p>

Show More

Keywords

code на задач source based

Related Articles


Deprecated: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 in /home/u483256323/domains/poorvam.com/public_html/subdomains/pore/includes/api.php on line 76
PORE

About

Connect