PyART: Python API Recommendation in Real-Time.

Saved in:
Bibliographic Details
Title: PyART: Python API Recommendation in Real-Time.
Authors: Xincheng He1 xinchenghe2016@gmail.com, Lei Xu1 xlei@nju.edu.cn, Xiangyu Zhang2 xyzhang@cs.purdue.edu, Rui Hao1 rui.hao.gm@gmail.com, Yang Feng1 fengyang@nju.edu.cn, Baowen Xu1 bwxu@nju.edu.cn
Source: ICSE: International Conference on Software Engineering. 5/22/2021, p1634-1645. 12p.
Subjects: Dylan (Computer program language), Python programming language, Artificial intelligence, Software engineering, Computer software packaging
Abstract: 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 recommending APIs for Python programs in real-time. It features a light-weight analysis to derive 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. [ABSTRACT FROM AUTHOR]
Copyright of ICSE: International Conference on Software Engineering is the property of Association for Computing Machinery and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Database: Engineering Source
FullText Links:
  – Type: pdflink
Text:
  Availability: 0
Header DbId: egs
DbLabel: Engineering Source
An: 155538800
AccessLevel: 6
PubType: Conference
PubTypeId: conference
PreciseRelevancyScore: 0
IllustrationInfo
Items – Name: Title
  Label: Title
  Group: Ti
  Data: PyART: Python API Recommendation in Real-Time.
– Name: Author
  Label: Authors
  Group: Au
  Data: <searchLink fieldCode="AR" term="%22Xincheng+He%22">Xincheng He</searchLink><relatesTo>1</relatesTo><i> xinchenghe2016@gmail.com</i><br /><searchLink fieldCode="AR" term="%22Lei+Xu%22">Lei Xu</searchLink><relatesTo>1</relatesTo><i> xlei@nju.edu.cn</i><br /><searchLink fieldCode="AR" term="%22Xiangyu+Zhang%22">Xiangyu Zhang</searchLink><relatesTo>2</relatesTo><i> xyzhang@cs.purdue.edu</i><br /><searchLink fieldCode="AR" term="%22Rui+Hao%22">Rui Hao</searchLink><relatesTo>1</relatesTo><i> rui.hao.gm@gmail.com</i><br /><searchLink fieldCode="AR" term="%22Yang+Feng%22">Yang Feng</searchLink><relatesTo>1</relatesTo><i> fengyang@nju.edu.cn</i><br /><searchLink fieldCode="AR" term="%22Baowen+Xu%22">Baowen Xu</searchLink><relatesTo>1</relatesTo><i> bwxu@nju.edu.cn</i>
– Name: TitleSource
  Label: Source
  Group: Src
  Data: <searchLink fieldCode="JN" term="%22ICSE%3A+International+Conference+on+Software+Engineering%22">ICSE: International Conference on Software Engineering</searchLink>. 5/22/2021, p1634-1645. 12p.
– Name: Subject
  Label: Subjects
  Group: Su
  Data: <searchLink fieldCode="DE" term="%22Dylan+%28Computer+program+language%29%22">Dylan (Computer program language)</searchLink><br /><searchLink fieldCode="DE" term="%22Python+programming+language%22">Python programming language</searchLink><br /><searchLink fieldCode="DE" term="%22Artificial+intelligence%22">Artificial intelligence</searchLink><br /><searchLink fieldCode="DE" term="%22Software+engineering%22">Software engineering</searchLink><br /><searchLink fieldCode="DE" term="%22Computer+software+packaging%22">Computer software packaging</searchLink>
– Name: Abstract
  Label: Abstract
  Group: Ab
  Data: 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 recommending APIs for Python programs in real-time. It features a light-weight analysis to derive 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. [ABSTRACT FROM AUTHOR]
– Name: AbstractSuppliedCopyright
  Label:
  Group: Ab
  Data: <i>Copyright of ICSE: International Conference on Software Engineering is the property of Association for Computing Machinery and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract.</i> (Copyright applies to all Abstracts.)
PLink https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=egs&AN=155538800
RecordInfo BibRecord:
  BibEntity:
    Identifiers:
      – Type: doi
        Value: 10.1109/ICSE43902.2021.00145
    Languages:
      – Code: eng
        Text: English
    PhysicalDescription:
      Pagination:
        PageCount: 12
        StartPage: 1634
    Subjects:
      – SubjectFull: Dylan (Computer program language)
        Type: general
      – SubjectFull: Python programming language
        Type: general
      – SubjectFull: Artificial intelligence
        Type: general
      – SubjectFull: Software engineering
        Type: general
      – SubjectFull: Computer software packaging
        Type: general
    Titles:
      – TitleFull: PyART: Python API Recommendation in Real-Time.
        Type: main
  BibRelationships:
    HasContributorRelationships:
      – PersonEntity:
          Name:
            NameFull: Xincheng He
      – PersonEntity:
          Name:
            NameFull: Lei Xu
      – PersonEntity:
          Name:
            NameFull: Xiangyu Zhang
      – PersonEntity:
          Name:
            NameFull: Rui Hao
      – PersonEntity:
          Name:
            NameFull: Yang Feng
      – PersonEntity:
          Name:
            NameFull: Baowen Xu
    IsPartOfRelationships:
      – BibEntity:
          Dates:
            – D: 22
              M: 05
              Text: 5/22/2021
              Type: published
              Y: 2021
          Titles:
            – TitleFull: ICSE: International Conference on Software Engineering
              Type: main
ResultId 1