Giter Site home page Giter Site logo

codas4cg's Introduction

CoDas4CG

Contests based Dataset for Code Generation

If you are using the dataset, please cite the following paper: H. Liu, M. Shen, J. Zhu, N. Niu, G. Li and L. Zhang, "Deep Learning Based Program Generation from Requirements Text: Are We There Yet?," in IEEE Transactions on Software Engineering, doi: 10.1109/TSE.2020.3018481. Available at: https://ieeexplore.ieee.org/document/9173704

There are Seven folders: AssistantTools , DatasetInSQL, Dataset, TestCases, Tools, CodeOfApproaches and GeneratedPrograms.

/Dataset contains the programming tasks and their corresponding implementations in different programming languages. Each subfolder under /Datset corresponds to a single programming task. Notably, we do not include the commercial script to crawl data.

/TestCases contains the test cases for the programming tasks in folder /Dataset. The names of the subfolders in /TestCases specify the names of the programming tasks. According to such names you may find the corresponding tasks under /Dataset. Notably, such test cases are collected from programming contest websites, and we do not leverage test case generation tools.

/Tools contains the source code of our tool kit.

/GeneratedPrograms contains the programs generated by each approach.

/CodeOfApproaches Implementation of evaluated approaches.

/DatasetInSQL: This folder is composed of a database that contains the whole dataset (Python programs only).

In case your approach is specially designed for Python, this database is strongly suggested for usage (compated to the /Dataset folder).

How to use the database:

#Retrieving original data (without preprocessing)

  1. RetrieveTasks(): Returns the description (requirements) of all tasks, each requirement is a text string

    SQL: select question from question

  2. RetrieveTask(ID): Return the task description of the specified ID

    SQL: select question from question where numId = ID

  3. RetreiveImplementations():Return all codes, and each code corresponds to a python file.

    SQL:select code from code

  4. RetreiveImplementations(ID):Return all codes corresponding to the specified topic id, and each code corresponds to a python file. s

    SQL: select code from code where numId = ID

#Retrieving processed data (preprocessing includes word segmentation and standarlization, et al.)

  1. RetrieveTasks(): Returns the description (requirements) of all tasks, each requirement is a text string

    SQL: select question from process_question

  2. RetrieveTask(ID): Return the task description of the specified ID

    SQL: select question from process_question where numId = ID

  3. RetreiveImplementations():Return all codes, and each code corresponds to a python file.

    SQL:select code from process_code

  4. RetreiveImplementations(ID):Return all codes corresponding to the specified topic id, and each code corresponds to a python file.

    SQL: select code from process_code where numId = ID

  5. RetreiveTestCasess(ID):Returns the test case corresponding to the specified question id.

    SQL:select input,output from testcase where numId= ID

/AssistantTools: This folder contains tools to calculate the BLEU, and to detect compilation errors in generated programs.

1.ComputeBLEU(pred, refer): Retrun BLEU between the generated code pred and the reference code refer

2.ComputeBLEU2(pred,refers):Retrun BLEU of code pred according to a series of refer

3.hasCompilerErrors(File name):Check whether the code has static and dynamic compilation errors

4.PreProcessALL(File requirements, File implements): Preprocess related requirements and programs

5.PreProcessReq(File requirements, File implements): Preprocess requirements (tasks)

6.PreProcessImp(File requirements, File implements): Preprocess the program

codas4cg's People

Contributors

ds4an avatar sakura182 avatar liuhuigmail avatar

Watchers

James Cloos 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.