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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper8
- Type4Py: Practical Deep Similarity Learning-Based Type Inference for PythonAmir M. Mir, Evaldas Latoskinas, Sebastian Proksch, Georgios GousiosICSE 2022 · 被引用 59 次
- Discovering Repetitive Code Changes in Python ML SystemsMalinda Dilhara, Ameya Ketkar, Nikhith Sannidhi, Danny DigICSE 2022 · 被引用 30 次
- Domain Adaptive Code Completion via Language Models and Decoupled Domain DatabasesZe Tang, Jidong Ge, Shangqing Liu, Tingwei Zhu 等ASE 2023 · 被引用 29 次
- 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 次
- Dataflow-Guided Retrieval Augmentation for Repository-Level Code CompletionWei Cheng, Yuhan Wu, Wei HuACL 2024 · 被引用 9 次
它引用的顶会 Paper1
相关 Paper
- API recommendation for machine learning libraries: how far are we?Moshi Wei, Yuchao Huang, Junjie Wang, Jiho Shin 等FSE 2022 · 被引用 6 次
- PyTER: effective program repair for Python type errorsWonseok Oh, Hakjoo OhFSE 2022 · 被引用 22 次
- PyAnalyzer: An Effective and Practical Approach for Dependency Extraction from Python CodeWuxia Jin, Shuo Xu, Dawei Chen, Jiajun He 等ICSE 2024 · 被引用 4 次
- Discovering Parallelisms in Python ProgramsSiwei Wei, Guyang Song, Senlin Zhu, Ruoyi Ruan 等FSE 2023 · 被引用 1 次
- Static Type Recommendation for PythonKe Sun, Yifan Zhao, Dan Hao, Lu ZhangASE 2022 · 被引用 6 次
