
软件学报 ISSN 1000-9825, CODEN RUXUEW E-mail: jos@iscas.ac.cn
Journal of Software,2019,30(12):3714−3729 [doi: 10.13328/j.cnki.jos.005609] http://www.jos.org.cn
©中国科学院软件研究所版权所有. Tel: +86-10-62562563
基于代码结构知识的软件文档语义搜索方法
∗
林泽琦
1,2
,
邹艳珍
1,2, 3
,
赵俊峰
1,2,3
,
曹英魁
1,2
,
谢
冰
1,2
1
(高可信软件技术教育部重点实验室(北京大学),北京 100871)
2
(北京大学 信息科学技术学院,北京 100871)
3
(北京大学(天津滨海)新一代信息技术研究院,天津 300450)
通讯作者: 邹艳珍, E-mail: zouyz@sei.pku.edu.cn
摘 要: 自然语言文本形式的文档是软件项目的重要组成部分.如何帮助开发者在大量文档中进行高效、准确的
信息定位,是软件复用领域中的一个重要研究问题.提出了一种基于代码结构知识的软件文档语义搜索方法.该方法
从软件项目的源代码中解析出代码结构图,并以此作为领域特定的知识来帮助机器理解自然语言文本的语义.这一
语义信息与信息检索技术相结合,从而实现了对软件文档的语义检索.在 StackOverflow 问答文档数据集上的实验表
明,与多种文本检索方法相比,该方法在平均准确率(mean average precision,简称 MAP)上可以取得至少 13.77%的
提升.
关键词: 软件复用;自然语言文本;代码结构知识;信息检索;语义搜索
中图法分类号: TP311
中文引用格式: 林泽琦,邹艳珍,赵俊峰,曹英魁,谢冰.基于代码结构知识的软件文档语义搜索方法.软件学报,2019,30 (12):
3714−3729. http ://www.jos.org.cn/1000-9825/5609.htm
英文引用格式: Lin ZQ, Zou YZ, Zhao JF, Cao YK, Xie B. Software text semantic search approach based on code structure
knowledge. Ruan Jian Xue Bao/Journal of Software, 2019,30(12):3714−3729 (in Chinese). http://www.jos.org.cn/1000-
9825/5609.htm
Software Text Semantic Search Approach Based on Code Structure Knowled ge
LIN Ze-Qi
1,2
, ZOU Yan-Zhen
1,2,3
, ZHAO Jun-Feng
1,2,3
, CAO Ying-Kui
1,2
, XIE Bing
1,2
1
(Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education, Beijing 100871, China)
2
(School of Electronics Engineering and Computer Science, Peking University, Beijing 100871, China)
3
(Peking University Information Technology Institute (Tianjin Binhai), Tianjin 300450, China)
Abstra ct : Natural language text is a common form of knowledge representation in various software artifacts. During the practice of
software reuse, software developers usually need to search the large amount of textual resource. This paper presents a software text
semantic search approach based on code structure knowledge. This approach extracts a code structure graph from software source code
and leverages it as a domain-specific knowledge base to analyze the semantic meanings of natural language texts. The semantic
information is combined with information retrieval technology to re-rank text search results semantically. Experimental results on
StackOverflow dataset show that this approach achieves at least 13.77% improvement in mean average precision (MAP) comparing to
several text retrieval approaches.
Key words: software reuse; natural language text; code stru cture knowledge; infor mation r etri eval; semantic s earch
软件复用是在软件开发中避免重复劳动的解决方案,可以提高软件开发的效率与质量
[1]
.近年来,随着开源
∗ 基金项目: 国家重点研发计划(2016YFB1000801); 国家杰出青年科学基金(61525201)
Foundation item: National Key Research and Development Program (2016YFB1000801); National Science Fund for Distinguished
Young Scholars (61525201)
收稿时间: 2017-1 0-09; 修改时间: 2018-05-07; 采用时间: 2018-05-25
评论