Smart Contract Classification with a Bi-LSTM Based Approach

2020 
With the number of smart contracts growing rapidly, retrieving the relevant smart contracts quickly and accurately has become an important issue. A key step for recognizing the related smart contracts is able to classify them accurately. Different from traditional text, the smart contract is composed of several parts: source code, code comments and other useful information like account information. How to make good use of those different kinds of features for effective classification is a problem need to be solved. Inspired by this, we proposed a smart contract classification approach based on Bi-LSTM model and Gaussian LDA, which can use a variety of information as inputs of the model, including source code, comments, tags, account and other content information. Bi-LSTM is utilized to capture grammar rules and context information in source code, while Gaussian LDA model is employed to generate comments feature where the semantics of the comments are enriched by embeddings. We also use attention mechanism to focus on the more relevant features in smart contracts for tags and fuse account information to provide additional information for classification. The experimental results show that the classification performance of the proposed model is superior to other baseline models.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    6
    Citations
    NaN
    KQI
    []