arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.07220cs.CVcs.AIcs.CYcs.HC

面向纸笔计算机科学教育的手写代码识别

Handwritten Code Recognition for Pen-and-Paper CS Education

Stanford University(斯坦福大学);GNCode

Md Sazzad Islam, Moussa Koulako Bala Doumbouya, Christopher D. Manning, Chris Piech

AI总结:

针对纸笔CS教育中手写代码识别难的问题,提出结合OCR、缩进识别模块与低幻觉纠错语言模型的方法(错误率从30%降至5%)及端到端多模态识别方案,并发布手写代码数据集。

摘要:

通过让学生在纸上手写程序来教授计算机科学(CS)具备关键的教学优势:与使用搭载智能支持工具的集成开发环境(IDEs)或“反复试错”的方式相比,这种方法能让学生专注学习,且需要严谨思考。纸笔是人们熟悉的环境,还能减轻无计算机使用经验学生的认知负荷——对这些学生而言,仅基础的计算机操作就可能令人生畏。最后,这种教学方式为难以接触到计算机的学生提供了学习机会。\n然而,一个核心障碍是目前缺乏用于处理和运行手写程序的教学方法与支持软件。手写代码的光学字符识别(OCR)颇具挑战:或许由手写风格差异导致的微小OCR错误,很容易致使代码无法运行;而缩进识别对Python这类语言至关重要,但由于手写时水平间距不一致,该任务难度很高。我们的方法整合了两种创新方案。第一种将OCR与缩进识别模块、一款专为OCR后纠错设计且不会产生幻觉的语言模型相结合。据我们所知,该方法在手写代码识别任务上的表现超越了所有现有系统,它将现有最优技术30%的错误率降至5%,且极少对学生程序产生逻辑修正层面的幻觉。第二种方法利用多模态语言模型以端到端方式识别手写程序。我们希望这项成果能推动更多教学研究,助力实现计算机科学教育全民可及的目标。我们在https://github.com/mdoumbouya/codeocr 发布了一个手写程序与代码数据集,以支撑未来研究。

英文摘要:

Teaching Computer Science (CS) by having students write programs by hand on paper has key pedagogical advantages: It allows focused learning and requires careful thinking compared to the use of Integrated Development Environments (IDEs) with intelligent support tools or "just trying things out". The familiar environment of pens and paper also lessens the cognitive load of students with no prior experience with computers, for whom the mere basic usage of computers can be intimidating. Finally, this teaching approach opens learning opportunities to students with limited access to computers. However, a key obstacle is the current lack of teaching methods and support software for working with and running handwritten programs. Optical character recognition (OCR) of handwritten code is challenging: Minor OCR errors, perhaps due to varied handwriting styles, easily make code not run, and recognizing indentation is crucial for languages like Python but is difficult to do due to inconsistent horizontal spacing in handwriting. Our approach integrates two innovative methods. The first combines OCR with an indentation recognition module and a language model designed for post-OCR error correction without introducing hallucinations. This method, to our knowledge, surpasses all existing systems in handwritten code recognition. It reduces error from 30\% in the state of the art to 5\% with minimal hallucination of logical fixes to student programs. The second method leverages a multimodal language model to recognize handwritten programs in an end-to-end fashion. We hope this contribution can stimulate further pedagogical research and contribute to the goal of making CS education universally accessible. We release a dataset of handwritten programs and code to support future research at https://github.com/mdoumbouya/codeocr

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑