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.
The folder "FC2Code" contains the following files:
We obtained 320 code from LeetCode
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.
The relationships between the nodes and the code snippets, can only be used in the training phase.
We sort the nodes according to the code, can only be used in the training phase.
Our model can be divided into 2 stages:
convert flowchart into pseudo_code
convert (pseudo_code, code) pairs into pickled files:
model\second_stage\datasets\FC2Code\fc2code_dataset.py
train or test on the pickled files:
model\second_stage\run_batch.py