paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Improving Code Extraction from Coding Screencasts Using a Code-Aware Encoder-Decoder Model

使用代码感知的编码器-解码器模型改进编程录屏中的代码抽取
ASE 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)2023匹配度 2/10 · 该论文属于 PL 与机器学习交叉,使用 CodeT5 改进 OCR 代码抽取,与代码理解/开发者工具有关;但它不涉及静态分析、Agentic 程序、形式化验证、浮点程序分析或贝叶斯程序分析,与用户核心研究方向关联很弱。引用 7 inbox
Abdulkarim Malkadi, Ahmad Tayeb, Sonia Haiduc
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:用预训练代码大模型 CodeT5 对 OCR 结果做后处理,显著提升录屏与截图中的代码抽取准确率。

从教程视频中准确抽取代码对希望复用视频代码的开发者至关重要,但现有基于 OCR 的方法因代码复杂度高和录屏格式多样而常常出错。为此,作者提出 CodeT5-OCRfix:利用预训练的代码感知大语言模型 CodeT5 对 OCR 后的代码进行后处理修正。他们从 GitHub 上 1 万余个 Java 项目中采集源码截图,用 Tesseract 做 OCR,得到超过 58.5 万对 OCR 文本与真实代码配对数据,并据此微调 CodeT5。在截图与录屏帧上的实证评估表明,CodeT5-OCRfix 优于基线代码抽取模型,且时间效率更高,从而推进了从录屏与图像中抽取代码的技术水平。

问题
现有基于 OCR 的视频代码抽取方法在代码复杂、录屏格式多变时结果不准确,难以满足开发者复用教程代码的需求。
方法
提出 CodeT5-OCRfix,利用预训练的代码感知模型 CodeT5 对 Tesseract 的 OCR 输出进行后处理修正,并用从 1 万余个 GitHub Java 项目采集的 58.5 万余对 OCR/真实代码数据微调模型。
评估
在源码截图与录屏帧上进行实证评估,与基线代码抽取模型对比,结果显示 CodeT5-OCRfix 准确率更高且更省时。
原文摘要(Abstract)

Accurate automatic code extraction from tutorial videos is crucial for software developers seeking to reuse the code contained in these videos. Current methods using optical character recognition (OCR) often yield inaccurate results due to code complexity and variations in screencast formats. To address this issue, we introduce CodeT5-OCRfix, an approach that leverages the pre-trained code-aware large language model CodeT5 to enhance code extraction accuracy by post-processing OCRed code. We first collect a large and diverse dataset of source code screenshots captured from more than 10K Java projects from GitHub. We then apply the most widely used OCR engine for the task of code extraction from videos, Tesseract, on these screenshots and collect the OCRed code along with the ground truth code extracted from the Java files. We built a training dataset of more than 585K pairs of OCRed and ground truth code pairs, which we then used to fine-tune CodeT5, obtaining our model CodeT5-OCRfix. An empirical evaluation on both screenshots and screencast frames shows that CodeT5-OCRfix outperforms baseline code extraction models and is also more time-efficient. Our approach therefore improves the state-of-the-art in code extraction techniques from screencasts and images.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{MalkadiTH23,
  title = {Improving Code Extraction from Coding Screencasts Using a Code-Aware Encoder-Decoder Model},
  author = {Abdulkarim Malkadi and Ahmad Tayeb and Sonia Haiduc},
  booktitle = {ASE},
  year = {2023},
  doi = {10.1109/ase56229.2023.00184}
}