Documentation-Guided API Sequence Search without Worrying about the Text-API Semantic Gap

Hongwei Wei, Xiaohong Su, Weining Zheng, Wenxin Tao
{"title":"Documentation-Guided API Sequence Search without Worrying about the Text-API Semantic Gap","authors":"Hongwei Wei, Xiaohong Su, Weining Zheng, Wenxin Tao","doi":"10.1109/SANER56733.2023.00040","DOIUrl":null,"url":null,"abstract":"Developers often search for application programming interfaces (APIs) and their usage patterns to speed up the efficiency of software development. This paper focuses on the API sequence search task, which refers to using a function-relevant textual query to search for API sequences mined from open-source software repositories that can implement this function. However, the severe semantic gap between text and API makes it challenging to discover the correspondence between natural language queries and desired API sequences. Therefore, we propose a method called documentation-guided API sequence search (DGAS), through which we do not need to worry about the semantic gap between text and API. Specifically, DGAS consists of documentation-guided cross-modal attention (DGCA) and documentation-guided cross-modal matching (DGCM). DGCA calculates the cross-modal attention map using features extracted from the same modality (i.e., API documentation sequence and textual query) instead of from different modalities (i.e., API sequence and textual query) to bridge the semantic gap during the cross-modal attention phase. Besides, DGCM takes API documentation as supplementary information of API sequence to bridge the semantic gap during the cross-modal matching phase. We use the API documentation to extend the existing dataset for API sequence generation to construct a dataset for API sequence search to evaluate DGAS. Experimental results show that DGAS outperforms the baseline methods.","PeriodicalId":281850,"journal":{"name":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","volume":"15 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SANER56733.2023.00040","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Developers often search for application programming interfaces (APIs) and their usage patterns to speed up the efficiency of software development. This paper focuses on the API sequence search task, which refers to using a function-relevant textual query to search for API sequences mined from open-source software repositories that can implement this function. However, the severe semantic gap between text and API makes it challenging to discover the correspondence between natural language queries and desired API sequences. Therefore, we propose a method called documentation-guided API sequence search (DGAS), through which we do not need to worry about the semantic gap between text and API. Specifically, DGAS consists of documentation-guided cross-modal attention (DGCA) and documentation-guided cross-modal matching (DGCM). DGCA calculates the cross-modal attention map using features extracted from the same modality (i.e., API documentation sequence and textual query) instead of from different modalities (i.e., API sequence and textual query) to bridge the semantic gap during the cross-modal attention phase. Besides, DGCM takes API documentation as supplementary information of API sequence to bridge the semantic gap during the cross-modal matching phase. We use the API documentation to extend the existing dataset for API sequence generation to construct a dataset for API sequence search to evaluate DGAS. Experimental results show that DGAS outperforms the baseline methods.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
文档导向的API序列搜索,无需担心文本-API语义差距
开发人员经常搜索应用程序编程接口(api)及其使用模式,以加快软件开发的效率。本文重点研究API序列搜索任务,该任务是指使用与函数相关的文本查询,从开源软件库中挖掘可以实现该功能的API序列。然而,文本和API之间严重的语义差距使得发现自然语言查询与期望的API序列之间的对应关系具有挑战性。因此,我们提出了一种称为文档引导API序列搜索(document -guided API sequence search, DGAS)的方法,通过该方法我们无需担心文本和API之间的语义差距。具体来说,DGAS包括文档引导的跨模态注意(DGCA)和文档引导的跨模态匹配(DGCM)。DGCA使用从同一模态(即API文档序列和文本查询)而不是从不同模态(即API序列和文本查询)中提取的特征来计算跨模态注意图,以弥合跨模态注意阶段的语义差距。此外,DGCM将API文档作为API序列的补充信息,以弥补跨模态匹配阶段的语义缺口。我们使用API文档扩展现有的API序列生成数据集,以构建用于API序列搜索的数据集来评估DGAS。实验结果表明,DGAS方法优于基线方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
TemLock: A Lightweight Template-based Approach for Fixing Deadlocks Caused by ReentrantLock Pseudocode to Code Based on Adaptive Global and Local Information µDetector: Automated Intrusion Detection for Microservices Documentation-Guided API Sequence Search without Worrying about the Text-API Semantic Gap Weak Labelling for File-level Source Code Classification
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1