BIROn - Birkbeck Institutional Research Online

    Context-aware API recommendation using tensor factorization

    Yu, Z. and Chen, C. and Yongchao, W. and Han, Tingting and Chen, Taolue (2023) Context-aware API recommendation using tensor factorization. Science China Information Sciences , ISSN 1869-1919.

    [img]
    Preview
    Text
    scis22.pdf - Author's Accepted Manuscript

    Download (6MB) | Preview

    Abstract

    An activity constantly engaged by most programmers in coding is to search for appropriate application programming interfaces (APIs). Contextual information is widely recognized to play a crucial role in effective API recommendation, but it is largely overlooked in practice. In this paper, we propose context-aware API recommendation using tensor factorization (CARTF), a novel API recommendation approach in considering programmers’ working context. To this end, we use tensors to explicitly represent the query-API-context triadic relation. When a new query is made, CARTF harnesses word embeddings to retrieve similar user queries, based on which a third-order tensor is constructed. CARTE then applies non-negative tensor factorization to complete missing values in the tensor and the Smith–Waterman algorithm to identify the most matched context. Finally, the ranking of the candidate APIs can be derived based on which API sequences are recommended. Our evaluation confirms the effectiveness of CARTF for class-level and method-level API recommendations, outperforming state-of-the-art baseline approaches against a number of performance metrics, including success rate, precision, and recall.

    Metadata

    Item Type: Article
    Keyword(s) / Subject(s): API recommendation, Tensor factorization, Context awareness, Word embedding, Intelligent software development
    School: Birkbeck Faculties and Schools > Faculty of Science > School of Computing and Mathematical Sciences
    Depositing User: Tingting Han
    Date Deposited: 30 Oct 2023 14:23
    Last Modified: 12 Jan 2024 01:10
    URI: https://eprints.bbk.ac.uk/id/eprint/52318

    Statistics

    Activity Overview
    6 month trend
    18Downloads
    6 month trend
    52Hits

    Additional statistics are available via IRStats2.

    Archive Staff Only (login required)

    Edit/View Item Edit/View Item