吉林大学学报(理学版) ›› 2022, Vol. 60 ›› Issue (5): 1097-1102.

• • 上一篇    下一篇

基于词向量的npm包推荐标签方法

孙凯1, 刘宣彤2, 张莉3, 刘华虓1, 王禹1, 郜山权1   

  1. 1. 吉林大学 计算机科学与技术学院, 长春 130012; 2. 外交学院 英语系,  北京 100037;
    3. 白城医学高等专科学校 信息化学院, 吉林 白城 137000
  • 收稿日期:2021-06-12 出版日期:2022-09-26 发布日期:2022-09-26
  • 通讯作者: 张莉 E-mail:zh_li7213@163.com

Recommended Tag Method for npm Packages Based on Word Vector

SUN Kai1, LIU Xuantong2, ZHANG Li3, LIU Huaxiao1, WANG Yu1, GAO Shanquan1   

  1. 1. College of Computer Science and Technology, Jilin University, Changchun 130012, China;
    2. Department of English, China Foreign Affairs University, Beijing 100037, China;
    3. College of Information Technology, Baicheng Medical College, Baicheng 137000, Jilin Province, China
  • Received:2021-06-12 Online:2022-09-26 Published:2022-09-26

摘要: 针对开源npm(node package manager)社区标签机制不完善的问题, 提出一种自动为开源第三方库npm包推荐标签的方法. 首先, 根据npm社区中现有标签间的关联关系对标签聚类, 在解决标签同义词问题的同时建立标签库; 其次, 利用词向量技术计算npm包的eadme文档与标签库中标签的语义相关程度; 最后, 根据相关程度对标签进行排序, 生成标签推荐列表并完成标签推荐. 实验结果表明, 该方法可有效地为npm包推荐标签, 准确率Recall@3为49.1%, Recall@5为56.3%, Recall@10为66.9%.

关键词: 标签推荐, npm包, 词向量

Abstract: Aiming at the problem  of the imperfect tagging mechanism in the open source npm (node package manager) community, we proposed a method to automatically recommend tags for open source third-party library npm packages. Firstly,  according to the association relationship between existing tags in the npm community, the tags were clustered  and a tag library was  established  while solving the problem of tag synonyms. Secondly,  the word vector technology was used to calculate the semantic correlation degree between the Readme document of the npm package and the tags in the tag library. Finally, the tags were sorted according to  the degree of correlation to generate a tag recommendation list and complete the tag recommendation. The experimental results show that this method can effectively recommend tags for npm packages, and the accuracy rate of Recall@3 is 49.1%, Recall@5 is 56.3%, and Recall@10 is 66.9%.

Key words: tag recommendation, npm package, word vector

中图分类号: 

  • TP311