Lune

ICSE2021顶会

PyART: Python API Recommendation in Real-Time

Xincheng He, Lei Xu, Xiangyu Zhang, Rui Hao, Yang Feng, Baowen Xu

摘要

API recommendation in real-time is challenging for dynamic languages like Python. Many existing API recommendation techniques are highly effective, but they mainly support static languages. A few Python IDEs provide API recommendation functionalities based on type inference and training on a large corpus of Python libraries and third-party libraries. As such, they may fail to recommend or make poor recommendations when type information is missing or target APIs are project-specific. In this paper, we propose a novel approach, PyART, to recommend APIs for Python programs in real-time. It features a light-weight analysis to derives so-called optimistic data-flow, which is neither sound nor complete, but simulates the local data-flow information humans can derive. It extracts three kinds of features: data-flow, token similarity, and token co-occurrence, in the context of the program point where a recommendation is solicited. A predictive model is trained on these features using the Random Forest algorithm. Evaluation on 8 popular Python projects demonstrates that PyART can provide effective API recommendations. When historic commits can be leveraged, which is the target scenario of a state-of-the-art tool ARIREC, our average top-1 accuracy is over 50% and average top-10 accuracy over 70%, outperforming APIREC and Intellicode (i.e., the recommendation component in Visual Studio) by 28.48%-39.05% for top-1 accuracy and 24.41%-30.49% for top-10 accuracy. In other applications such as when historic comments are not available and cross-project recommendation, PyART also shows better overall performance. The time to make a recommendation is less than a second on average, satisfying the real-time requirement.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper8

  1. Type4Py: Practical Deep Similarity Learning-Based Type Inference for PythonAmir M. Mir, Evaldas Latoskinas, Sebastian Proksch, Georgios GousiosICSE 2022 · 59 次引用
  2. Discovering Repetitive Code Changes in Python ML SystemsMalinda Dilhara, Ameya Ketkar, Nikhith Sannidhi, Danny DigICSE 2022 · 30 次引用
  3. Domain Adaptive Code Completion via Language Models and Decoupled Domain DatabasesZe Tang, Jidong Ge, Shangqing Liu, Tingwei Zhu 等ASE 2023 · 29 次引用
  4. Let's Chat to Find the APIs: Connecting Human, LLM and Knowledge Graph through AI ChainQing Huang, Zhenyu Wan, Zhenchang Xing, Changjing Wang 等ASE 2023 · 15 次引用
  5. Dataflow-Guided Retrieval Augmentation for Repository-Level Code CompletionWei Cheng, Yuhan Wu, Wei HuACL 2024 · 9 次引用

它引用的 Paper1

  1. Demystify official API usage directives with crowdsourced API misuse scenarios, erroneous code examples and patchesXiaoxue Ren, Jiamou Sun, Zhenchang Xing, Xin Xia 等ICSE 2020 · 28 次引用

相关 Paper

  1. API recommendation for machine learning libraries: how far are we?Moshi Wei, Yuchao Huang, Junjie Wang, Jiho Shin 等FSE 2022 · 6 次引用
  2. PyTER: effective program repair for Python type errorsWonseok Oh, Hakjoo OhFSE 2022 · 22 次引用
  3. PyAnalyzer: An Effective and Practical Approach for Dependency Extraction from Python CodeWuxia Jin, Shuo Xu, Dawei Chen, Jiajun He 等ICSE 2024 · 4 次引用
  4. Discovering Parallelisms in Python ProgramsSiwei Wei, Guyang Song, Senlin Zhu, Ruoyi Ruan 等FSE 2023 · 1 次引用
  5. Static Type Recommendation for PythonKe Sun, Yifan Zhao, Dan Hao, Lu ZhangASE 2022 · 6 次引用
黄昏的海面,两侧是细线勾勒的悬崖