GithubHelp home page GithubHelp logo

icpc-scs-hybrid's Introduction

SCS-Hybrid: Decision-based Hybrid Source Code Summarization

A. Framework

Previous studies mainly focused on information retrieval-based (IR) approaches and deep learning-based (DL) approaches.

Since the quality of the comments generated by different kinds of approaches complements each other in some cases, the main objective of this study is to design a decision-based hybrid approach, which can automatically return the higher quality comment from the comments generated by these two kinds of approaches.

B. Human Study

Here we give a sample of questionnaire used in our human study.

Each participant is asked to score each comment in terms of similarity, naturalness, and informativeness aspects for two comments generated by SCS-Hybrid and the baseline Rencos respectively.

During the comment quality evaluation process, the participants can search the Internet for relevant information and unfamiliar concepts.

To guarantee a fair comparison, the participants do not know which comment is generated by which approach, and the order of questionnaires is different for different participants.

To guarantee the comment evaluation quality, we need each participant to review only 50 code snippets in half a day to avoid fatigue.

Overall, the details can be found in 'Human.xlsx'.

C. Public Pre-trained Models

https://huggingface.co/SCS/Pre-trained-model

Fine-tuned in JCSD: https://huggingface.co/SCS/Fine-tuned-JCSD

Fine-tuned in PCSD: https://huggingface.co/SCS/Fine-tuned-PCSD

SCS-IR in JCSD: /model/JCSD/kernel.pkl & bias.pkl

SCS-IR in PCSD: /model/PCSD/kernel.pkl & bias.pkl

Decision Model in JCSD: /model/JCSD/java_decide.model

Decision Model in PCSD: /model/JCSD/python_decide.model

D. Baselines

For the LSI, VSM, NNGen, and BM25, we implement them by code in https://github.com/NTDXYG/IR-based-Code-Comment-Generation

For the TL-CodeSum, we implement it by code in https://github.com/xing-hu/TL-CodeSum

For the Rencos, we implement it by code in https://github.com/NTDXYG/Rencos_modify

For the Transformer, we implement it by code in https://github.com/wasiahmad/NeuralCodeSum

For the CodeBERT, we implement it by code in https://github.com/microsoft/CodeBERT/tree/master/CodeBERT/code2nl

For the CodeNN and GRNMT, we re-implement them with the description of the original paper.

E. How to use

# Step 1. First propose the source code and get the sbt sequence
code_seq, sbt = sbt_utils_java.transformer(code)

# Step 2. Then use SCS-IR compute the features
result = get_sim_info(java_scsir, code_seq, sbt)

# Step 3. Make the decision which method to use
if (java_model_decide.predict([[result['code_score'], result['ast_score'], result['inner_score']]])[0] == 0):
	return result['sim_nl']
else:
	dl_nl = get_dl_comment(java_scsdl, code_seq, sbt)
	return dl_nl

icpc-scs-hybrid's People

Contributors

ntdxyg avatar

Watchers

 avatar

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.