Giter Site home page Giter Site logo

wssun / ast4plu Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 20.33 MB

Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?

License: MIT License

Python 39.05% Java 48.74% ANTLR 7.98% Swift 0.07% C++ 0.15% JavaScript 3.20% Rust 0.40% C 0.01% Scheme 0.19% Shell 0.06% Perl 0.13%

ast4plu's Introduction

AST4PLU

Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?
arXiv

@article{2023-AST4PLU,
  title={Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?},
  author={Weisong Sun, Chunrong Fang, Yun Miao, Yudu You, Mengzhe Yuan, Yuchen Chen, Quanjun Zhang, An Guo, Xiang Chen, Yang Liu, Zhenyu Chen},
  journal={arXiv preprint arXiv:2312.00413},
  year={2023}
}

Introduction

This repository contains the implementation code for the experiments in the paper "Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?".

data-process - Contains code for generating AST using JDT, srcML, Antlr and Tree-sitter, and code for preprocessing AST into BFS sequence, SBT, AST Path, Binary Tree and Split AST.

code-clone-detection - Contains code for the code clone detection task using BiLSTM, Transformer, Child-Sum TreeLSTM, N-ary TreeLSTM and AST-Trans.

code-summarization - Contains code for the code summarization task using BiLSTM, Transformer, Child-Sum TreeLSTM, N-ary TreeLSTM and AST-Trans.

code-search - Contains code for the code search task using BiLSTM, Transformer, Child-Sum TreeLSTM, N-ary TreeLSTM and AST-Trans.

Install environment

pip install -r requirements.txt

pytorch-geometric (used for AST-Trans) can be installed by pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://pytorch-geometric.com/whl/torch-1.10.0%2Bcu102.html

Data preprocess

Please refer to the README in data-process directory.

Dataset preprocessed by us can be downloaded here.

Run

Run run.py in the code directory.

For specific parameter settings, please refer to the README under each subfolder.

Test

Run evaluator.py in the evaluator directory.

For more details, please refer to the README under each subfolder.

ast4plu's People

Contributors

skeleton-q avatar youyudu avatar suda1927406040 avatar wssun avatar

Stargazers

huacheng avatar  avatar abcxyz avatar 陈皓宇 avatar  avatar  avatar

Watchers

 avatar

Forkers

dqcx2411

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.