吉林大学学报(理学版) ›› 2022, Vol. 60 ›› Issue (2): 316-320.

• • 上一篇    下一篇

基于seq2seq模型的标签推荐方法

刘磊1, 王昊1, 孙凯1, 郜山权1, 刘宣彤2   

  1. 1. 吉林大学 计算机科学与技术学院, 长春 130012; 2. 外交学院 英语系, 北京 100037
  • 收稿日期:2021-06-12 出版日期:2022-03-26 发布日期:2022-03-26
  • 通讯作者: 孙凯 E-mail:skai@jlu.edu.cn

Tag Recommendation Mehtod Based on seq2seq Model

LIU Lei1, WANG Hao1, SUN Kai1, GAO Shanquan1, LIU Xuantong2   

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

摘要: 针对NPM平台上存在大量的软件包没有标签或标记不完善的问题, 提出一种基于seq2seq模型的深度学习方法为软件包推荐标签. 首先, 利用ECMAScript工具分析软件包的源码构建出包的函数调用图, 遍历函数调用图从而将软件包转换成一组具有包语义信息的函数调用序列; 其次, 训练seq2seq模型, 并将训练好的模型用于软件包的标签推荐工作, 该模型能将包的函数调用序列映射到一组预测的标签序列上, 从而完成软件包的标签推荐. 实验结果表明, 该方法能为软件包推荐一组合理的标签, 准确率达82.6%.

关键词: 标签推荐, 深度学习, 程序分析, 注意力模型

Abstract: Aiming at the problem that a large number of software packages had no tags or imperfect tags on node package manager (NPM) platform, we proposed a deep learning method based on the seq2seq model to recommend tags for software packages. Firstly, we used ECMAScript tools to analyze the source code of software package, constructed function call graphs of the package, and traversed the function call graph, so as to convert the software package into a set of function call sequences with package semantic information. Secondly, we trained the seq2seq model and applied the trained model to tag recommendation of software package. The trained model could map the function call sequence of package to a group of predicted tag sequence, so as to complete the tag recommendation of software packge. The experimental results show that the method can recommend a reasonable set of tags for the software package, and the accuracy is 82.6%.

Key words: tag recommendation, deep learning, program analysis, attention model

中图分类号: 

  • TP311