Lune

EMNLP Findings2022

Code Generation From Flowcharts with Texts: A Benchmark Dataset and An Approach

Zejie Liu, Xiaoyu Hu, Deyu Zhou, Lin Li, Xu Zhang, Yanzheng Xiang

Abstract

Currently, researchers focus on generating codes from the requirement documents.However, current approaches still perform poorly on some requirements needing complex problemsolving skills.In reality, to tackle such complex requirements, instead of directly translating requirement documents into codes, software engineers write codes via unified modeling language diagrams, such as flowcharts, an intermediate tool to analyze and visualize the system.Therefore, we propose a new source code generation task, that is, to generate source code from flowcharts with texts.We manually construct a benchmark dataset containing 320 flowcharts with their corresponding source codes 1 .Obviously, it is not straightforward to employ the current approaches for the new source code generation task since (1) the flowchart is a graph that contains various structures, including loop, selection, and others which is different from texts; (2) the connections between nodes in the flowchart are abundant and diverse which need to be carefully handled.To solve the above problems, we propose a two-stage code generation model.In the first stage, a structure recognition model is employed to transform the flowchart into pseudo-code containing the structural conventions of a typical programming language such as while, if.In the second stage, a code generation model is employed to convert the pseudo-code into code.Experimental results show that the proposed approach can achieve some improvement over the baselines. 1 https://github.com/LiuZeJie97/Code-Generation-From-Flowcharts-with-Texts-A-Benchmark-Dataset-and-An-Approach Requirement document:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.Flowchart: The sum of nums[i] and nums[j] is equal to the target Set n to the length of the array num.J is less than n?I is less than n? Increment i Increment j Yes No Yes No Yes No Define j as the index of the array, and the initial value of j is i+1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. PatentLMM: Large Multimodal Model for Generating Descriptions for Patent FiguresShreya Shukla, Nakul Sharma, Manish Gupta, Anand MishraAAAI 2025 · 6 citations
  2. Follow the Flow: Fine-grained Flowchart Attribution with Neurosymbolic AgentsManan Suri, Puneet Mathur, Nedim Lipka, Franck Dernoncourt et al.EMNLP 2025 · 1 citation
  3. LMR-BENCH: Evaluating LLM Agent's Ability on Reproducing Language Modeling ResearchShuo Yan, Ruochen Li, Ziming Luo, Zimu Wang et al.EMNLP 2025
  4. From Diagrams to Code: Multilingual Programming with Visual DesignLinzheng Chai, Jian Yang, Shukai Liu, Wei Zhang et al.ICML 2026

Related papers

  1. Flow2Code: Evaluating Large Language Models for Flowchart-based Code Generation CapabilityMengliang He, Jiayi Zeng, Yankai Jiang, Wei Zhang et al.ACL Findings 2025 · 5 citations
  2. SkCoder: A Sketch-based Approach for Automatic Code GenerationJia Li, Yongmin Li, Ge Li, Zhi Jin et al.ICSE 2023 · 50 citations
  3. From Words to Structured Visuals: A Benchmark and Framework for Text-to-Diagram Generation and EditingJingxuan Wei, Cheng Tan, Qi Chen, Gaowei Wu et al.CVPR 2025
  4. Doc2Chart: Intent-Driven Zero-Shot Chart Generation from DocumentsAkriti Jain, Pritika Ramu, Aparna Garimella, Apoorv SaxenaEMNLP 2025
  5. RealBench: A Repo-Level Code Generation Benchmark Aligned with Real-World Software Development PracticesJia Li, Hongyi Deng, Yiran Zhang, Kechi Zhang et al.FSE 2026
Dusk over the sea between two cliffs drawn in fine vertical lines