Pseudocode in a scholarly paper provides a concise way to express the algorithms implemented therein. Pseudocode can also be thought of as an intermediary representation that helps bridge the gap between programming languages and natural languages. Having access to a large collection of pseudocode can provide various benefits ranging from enhancing algorithmic understanding, facilitating further algorithmic design, to empowering NLP or computer vision based models for tasks such as automated code generation and optical character recognition (OCR). We have created a large pseudocode collection by extracting nearly 320,000 pseudocode examples from arXiv papers. This process involved scanning over $2.2$ million scholarly papers, with 1,000 of them being manually inspected and labeled. Our approach encompasses an extraction mechanism tailored to optimize the coverage and a validation mechanism based on random sampling to check its accuracy and reliability, given the inherent heterogeneity of the collection. In addition, we offer insights into common pseudocode structures, supported by clustering and statistical analyses. Notably, these analyses indicate an exponential-like growth in the usage of pseudocodes, highlighting their increasing significance.
翻译:学术论文中的伪代码提供了一种简洁表达所实现算法的方式。伪代码亦可视为一种中间表示,有助于弥合编程语言与自然语言之间的鸿沟。拥有大规模伪代码集合可带来诸多益处:从增强算法理解、促进后续算法设计,到赋能基于自然语言处理或计算机视觉的模型(如自动代码生成和光学字符识别任务)。我们通过从arXiv论文中提取近32万条伪代码示例,构建了一个大规模伪代码集合。该过程涉及扫描超过220万篇学术论文,其中1000篇经过人工核查与标注。鉴于集合固有的异质性,我们的方法包含:为优化覆盖率而定制的提取机制,以及基于随机抽样的验证机制以检验其准确性与可靠性。此外,我们通过聚类与统计分析,深入解析了常见伪代码结构。值得注意的是,这些分析表明伪代码使用量呈类指数增长,凸显其日益增长的重要性。