psc2code:从编程屏幕截图中提取去噪代码
psc2code: Denoising Code Extraction from Programming Screencasts
摘要:
在本文中,我们提出了一种名为psc 2code的方法去噪的过程中提取的源代码从编程屏幕。首先,psc 2code利用基于卷积神经网络的图像分类来去除非编码和噪声编码帧。然后,psc 2code执行边缘检测和基于聚类的图像分割,以检测代码帧中的子窗口,并根据检测到的子窗口,识别并裁剪最有可能是代码编辑器的屏幕区域。最后,psc 2code调用专业OCR工具的API从裁剪的代码区域提取源代码,并利用编程截屏中的OCRed跨帧信息和大型源代码语料库的统计语言模型来纠正OCRed源代码中的错误。我们对YouTube上的1,142个编程屏幕进行了实验。我们发现,我们的基于CNN的图像分类技术可以有效地去除非代码和噪声代码帧,实现了0.95的F1分数的有效代码帧。基于psc 2code去噪后的源代码,我们实现了两个应用:1)一个节目截屏搜索引擎; 2)一个交互增强的节目截屏观看工具。基于从收集的1,142个编程截屏中提取的源代码,我们的实验表明,我们的编程截屏搜索引擎分别达到了0.93、0.81和0.63的精确度@5、10和20。
英文摘要:
In this paper, we propose an approach named psc2code to denoise the process of extracting source code from programming screencasts. First, psc2code leverages the Convolutional Neural Network based image classification to remove non-code and noisy-code frames. Then, psc2code performs edge detection and clustering-based image segmentation to detect sub-windows in a code frame, and based on the detected sub-windows, it identifies and crops the screen region that is most likely to be a code editor. Finally, psc2code calls the API of a professional OCR tool to extract source code from the cropped code regions and leverages the OCRed cross-frame information in the programming screencast and the statistical language model of a large corpus of source code to correct errors in the OCRed source code. We conduct an experiment on 1,142 programming screencasts from YouTube. We find that our CNN-based image classification technique can effectively remove the non-code and noisy-code frames, which achieves an F1-score of 0.95 on the valid code frames. Based on the source code denoised by psc2code, we implement two applications: 1) a programming screencast search engine; 2) an interaction-enhanced programming screencast watching tool. Based on the source code extracted from the 1,142 collected programming screencasts, our experiments show that our programming screencast search engine achieves the precision@5, 10, and 20 of 0.93, 0.81, and 0.63, respectively.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。