{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,1]],"date-time":"2026-02-01T04:55:31Z","timestamp":1769921731874,"version":"3.49.0"},"reference-count":39,"publisher":"World Scientific Pub Co Pte Ltd","issue":"06","funder":[{"DOI":"10.13039\/501100004731","name":"Natural Science Foundation of Zhejiang Province","doi-asserted-by":"crossref","award":["LZ25F020011"],"award-info":[{"award-number":["LZ25F020011"]}],"id":[{"id":"10.13039\/501100004731","id-type":"DOI","asserted-by":"crossref"}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["62372145"],"award-info":[{"award-number":["62372145"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["61902096"],"award-info":[{"award-number":["61902096"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]},{"name":"Research and Development Plan of Zhejiang Province","award":["2023C03200"],"award-info":[{"award-number":["2023C03200"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Int. J. Soft. Eng. Knowl. Eng."],"published-print":{"date-parts":[[2025,6]]},"abstract":"<jats:p> During software development, developers often need appropriate but unfamiliar APIs to implement a specific functionality. Under such circumstances, developers tend to leverage search tools to seek for the relevant APIs. However, there are always semantic gaps between query words and APIs, which negatively affects the performance of these tools. In this study, we introduce Glo-APIRec, a method that combines global semantics with local context to estimate the semantic relevance between query words and APIs to recommend APIs. In this method, the Transformer model is employed to obtain global semantics, while the Word2Vec model is utilized to capture local context using a fixed-size window. First, Glo-APIRec collects millions of Java projects from GitHub to construct the corpus. Afterward, a set of tuples consisting of words and APIs is built by extracting comments and API sequences from the source code files. Finally, Transformer is employed to capture long distance semantics about API sequences and code comments. Meanwhile, Word2Vec is used to generate word vectors to capture the local context by introducing the random shuffling strategy to break the positions of words and APIs in the tuples. We evaluate the performance of Glo-APIRec with 30 sentence-level queries. Experimental results show that Glo-APIRec can achieve 0.600 in terms of SuccessRate for top-1 recommendation and 0.900 for top-10 recommendation. When recommending 10 APIs, Glo-APIRec can achieve 0.480, 0.703 and 0.717 in terms of precision, Mean Reciprocal Rank ([Formula: see text]) and Normalized Discounted Cumulative Gain ([Formula: see text]), and outperforms the state-of-the-art method by 26.2%, 31.7% and 27.9%, respectively. <\/jats:p>","DOI":"10.1142\/s0218194025500275","type":"journal-article","created":{"date-parts":[[2025,5,16]],"date-time":"2025-05-16T14:32:43Z","timestamp":1747405963000},"page":"917-941","source":"Crossref","is-referenced-by-count":1,"title":["Generative API Recommendation Based on Global Semantics and Local Context"],"prefix":"10.1142","volume":"35","author":[{"ORCID":"https:\/\/orcid.org\/0009-0006-6013-0458","authenticated-orcid":false,"given":"Shuoming","family":"Li","sequence":"first","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8919-1613","authenticated-orcid":false,"given":"Dongjin","family":"Yu","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-1282-6219","authenticated-orcid":false,"given":"Xin","family":"Chen","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0005-1713-3832","authenticated-orcid":false,"given":"Xulin","family":"Fan","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-7142-7398","authenticated-orcid":false,"given":"Dengfa","family":"Luo","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2945-7867","authenticated-orcid":false,"given":"Tong","family":"Wu","sequence":"additional","affiliation":[{"name":"School of Computer Science and Technology, Zhejiang Gongshang University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-0936-2802","authenticated-orcid":false,"given":"Wangliang","family":"Yan","sequence":"additional","affiliation":[{"name":"College of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, P. R. China"},{"name":"Binjiang Institute, Hangzhou Dianzi University, Hangzhou, P. R. China"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"219","published-online":{"date-parts":[[2025,6,19]]},"reference":[{"key":"S0218194025500275BIB001","volume-title":"Proc. 24th Text Retrieval Conf.","author":"Agichtein E.","year":"2015"},{"key":"S0218194025500275BIB002","doi-asserted-by":"publisher","DOI":"10.1145\/3212695"},{"key":"S0218194025500275BIB003","doi-asserted-by":"publisher","DOI":"10.1145\/1076034.1076135"},{"key":"S0218194025500275BIB004","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2015.18"},{"key":"S0218194025500275BIB005","doi-asserted-by":"publisher","DOI":"10.1109\/SANER56733.2023.00045"},{"key":"S0218194025500275BIB006","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-021-10040-2"},{"key":"S0218194025500275BIB007","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.48"},{"issue":"9","key":"S0218194025500275BIB008","first-page":"1960","volume":"47","author":"Chen X.","year":"2021","journal-title":"IEEE Trans. Softw. Eng."},{"key":"S0218194025500275BIB009","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2023.3252259"},{"key":"S0218194025500275BIB010","doi-asserted-by":"publisher","DOI":"10.1016\/j.jss.2020.110568"},{"key":"S0218194025500275BIB011","doi-asserted-by":"publisher","DOI":"10.18653\/v1\/2020.findings-emnlp.139"},{"key":"S0218194025500275BIB012","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-85481-4_12"},{"key":"S0218194025500275BIB013","doi-asserted-by":"publisher","DOI":"10.1145\/3180155.3180167"},{"key":"S0218194025500275BIB014","doi-asserted-by":"publisher","DOI":"10.1145\/2950290.2950334"},{"key":"S0218194025500275BIB015","first-page":"24286","volume-title":"Advances in Neural Information Processing Systems","volume":"34","author":"Hoe J. T.","year":"2021"},{"key":"S0218194025500275BIB016","doi-asserted-by":"publisher","DOI":"10.1109\/MSR.2013.6624052"},{"key":"S0218194025500275BIB017","doi-asserted-by":"publisher","DOI":"10.1145\/3238147.3238191"},{"key":"S0218194025500275BIB018","doi-asserted-by":"publisher","DOI":"10.1109\/TNSM.2021.3125028"},{"key":"S0218194025500275BIB019","doi-asserted-by":"publisher","DOI":"10.1145\/3470133"},{"key":"S0218194025500275BIB020","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2018.2876006"},{"key":"S0218194025500275BIB021","doi-asserted-by":"publisher","DOI":"10.1145\/2950290.2950341"},{"key":"S0218194025500275BIB022","doi-asserted-by":"publisher","DOI":"10.1016\/j.scico.2023.102927"},{"key":"S0218194025500275BIB023","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2015.42"},{"key":"S0218194025500275BIB024","doi-asserted-by":"publisher","DOI":"10.1145\/2824251"},{"key":"S0218194025500275BIB025","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE43902.2021.00041"},{"key":"S0218194025500275BIB026","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.47"},{"key":"S0218194025500275BIB027","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2022.3197063"},{"key":"S0218194025500275BIB028","doi-asserted-by":"publisher","DOI":"10.1145\/2884781.2884808"},{"key":"S0218194025500275BIB029","doi-asserted-by":"publisher","DOI":"10.1109\/TSC.2023.3245652"},{"key":"S0218194025500275BIB030","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2008.18"},{"key":"S0218194025500275BIB031","doi-asserted-by":"publisher","DOI":"10.1145\/3512768"},{"key":"S0218194025500275BIB032","doi-asserted-by":"publisher","DOI":"10.1109\/CSMR-WCRE.2014.6747213"},{"key":"S0218194025500275BIB033","doi-asserted-by":"publisher","DOI":"10.1145\/3439769"},{"key":"S0218194025500275BIB034","doi-asserted-by":"publisher","DOI":"10.1007\/s11432-021-3531-0"},{"key":"S0218194025500275BIB035","first-page":"25","volume-title":"Conf. Learning Theory","author":"Wang Y.","year":"2013"},{"key":"S0218194025500275BIB036","first-page":"376","volume-title":"Proc. 44th Int. Conf. Software Engineering","author":"Wei M.","year":"2022"},{"key":"S0218194025500275BIB037","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-013-9264-x"},{"key":"S0218194025500275BIB038","doi-asserted-by":"publisher","DOI":"10.1145\/2635868.2635874"},{"key":"S0218194025500275BIB039","doi-asserted-by":"publisher","DOI":"10.1007\/s11432-021-3529-9"}],"container-title":["International Journal of Software Engineering and Knowledge Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.worldscientific.com\/doi\/pdf\/10.1142\/S0218194025500275","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T07:38:43Z","timestamp":1750318723000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.worldscientific.com\/doi\/10.1142\/S0218194025500275"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6]]},"references-count":39,"journal-issue":{"issue":"06","published-print":{"date-parts":[[2025,6]]}},"alternative-id":["10.1142\/S0218194025500275"],"URL":"https:\/\/doi.org\/10.1142\/s0218194025500275","relation":{},"ISSN":["0218-1940","1793-6403"],"issn-type":[{"value":"0218-1940","type":"print"},{"value":"1793-6403","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6]]}}}