A Deep Learning Approach for a Source Code Detection Model Using Self-Attention

Joint Authors

Meng, Yao
Liu, Long

Source

Complexity

Issue

Vol. 2020, Issue 2020 (31 Dec. 2020), pp.1-15, 15 p.

Publisher

Hindawi Publishing Corporation

Publication Date

2020-09-16

Country of Publication

Egypt

No. of Pages

15

Main Subjects

Philosophy

Abstract EN

With the development of deep learning, many approaches based on neural networks are proposed for code clone.

In this paper, we propose a novel source code detection model At-biLSTM based on a bidirectional LSTM network with a self-attention layer.

At-biLSTM is composed of a representation model and a discriminative model.

The representation model firstly transforms the source code into an abstract syntactic tree and splits it into a sequence of statement trees; then, it encodes each of the statement trees with a deep-first traversal algorithm.

Finally, the representation model encodes the sequence of statement vectors via a bidirectional LSTM network, which is a classical deep learning framework, with a self-attention layer and outputs a vector representing the given source code.

The discriminative model identifies the code clone depending on the vectors generated by the presentation model.

Our proposed model retains both the syntactics and semantics of the source code in the process of encoding, and the self-attention algorithm makes the classifier concentrate on the effect of key statements and improves the classification performance.

The contrast experiments on the benchmarks OJClone and BigCloneBench indicate that At-LSTM is effective and outperforms the state-of-art approaches in source code clone detection.

American Psychological Association (APA)

Meng, Yao& Liu, Long. 2020. A Deep Learning Approach for a Source Code Detection Model Using Self-Attention. Complexity،Vol. 2020, no. 2020, pp.1-15.
https://search.emarefa.net/detail/BIM-1142209

Modern Language Association (MLA)

Meng, Yao& Liu, Long. A Deep Learning Approach for a Source Code Detection Model Using Self-Attention. Complexity No. 2020 (2020), pp.1-15.
https://search.emarefa.net/detail/BIM-1142209

American Medical Association (AMA)

Meng, Yao& Liu, Long. A Deep Learning Approach for a Source Code Detection Model Using Self-Attention. Complexity. 2020. Vol. 2020, no. 2020, pp.1-15.
https://search.emarefa.net/detail/BIM-1142209

Data Type

Journal Articles

Language

English

Notes

Includes bibliographical references

Record ID

BIM-1142209