pzy2000 / Code-Generation-From-Flowcharts-with-Texts-A-Benchmark-Dataset-and-An-Approach

Code for the paper "Code Generation From Flowcharts with Texts: A Benchmark Dataset and An Approach"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FC2Code

Code for the paper "Code Generation From Flowcharts with Texts: A Benchmark Dataset and An Approach". The presentation is here.

Our model is developed based on TRANX, please cite their paper if using our model.

Dataset Format

The folder "FC2Code" contains the following files:

code.txt

  We obtained 320 code from LeetCode

flowchart.txt

 We manually drew the flowchart for each code. The first part are the basic information of each node:

[node id] => [node type]: [the text contained within the node]

 The second part are the associations between nodes:

[node id] ( [yes\no\None] ) -> [node id]

 You can visit http://flowchart.js.org and translate the flowchart.txt into pictures.

mapping_relations.txt :

  The relationships between the nodes and the code snippets, can only be used in the training phase.

sequence.txt

 We sort the nodes according to the code, can only be used in the training phase.

Two-Stage Code Generation Model

Our model can be divided into 2 stages:

The First Stage

  1. convert flowchart into pseudo_code

    https://github.com/LiuZeJie97/flowchart-to-code

The Second Stage

  1. convert (pseudo_code, code) pairs into pickled files:

    model\second_stage\datasets\FC2Code\fc2code_dataset.py

  2. train or test on the pickled files:

    model\second_stage\run_batch.py

About

Code for the paper "Code Generation From Flowcharts with Texts: A Benchmark Dataset and An Approach"


Languages

Language:Jupyter Notebook 92.5%Language:Python 7.5%