Statistical Translation of English Texts to API Code Templates

被引:12
|
作者
Anh Tuan Nguyen [1 ]
Rigby, Peter C. [2 ]
Thanh Nguyen [3 ]
Palani, Dharani [2 ]
Karanfil, Mark [2 ]
Nguyen, Tien N. [4 ]
机构
[1] Axon US Corp, New York, NY 10036 USA
[2] Concordia Univ, Montreal, PQ, Canada
[3] Iowa State Univ, Ames, IA USA
[4] Univ Texas Dallas, Richardson, TX 75083 USA
基金
美国国家科学基金会;
关键词
D O I
10.1109/ICSME.2018.00029
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We develop T2API, a context-sensitive, graph-based statistical translation approach that takes as input an English description of a programming task and synthesizes the corresponding API code template for the task. We train T2API to statistically learn the alignments between English and API elements and determine the relevant API elements. The training is done on StackOverflow, a bilingual corpus on which developers discuss programming problems in two types of language: English and programming language. T2API considers both the context of the words in the input query and the context of API elements that often go together in the corpus. The derived API elements with their relevance scores are assembled into an API usage by GRASYN, a novel graph-based API synthesis algorithm that generates a graph representing an API usage from a large code corpus. Importantly, it is capable of generating new API usages from previously seen sub-usages. We curate a test benchmark of 250 real-world StackOverflow posts. Across the benchmark, T2API's synthesized snippets have the correct API elements with a median top-1 precision and recall of 67% and 100%, respectively. Four professional developers and five graduate students judged that 77% of our top synthesized API code templates are useful to solve the problem presented in the StackOverflow posts.
引用
收藏
页码:194 / 205
页数:12
相关论文
共 50 条
  • [1] Statistical Translation of English Texts to API Code Templates
    Anh Tuan Nguyen
    Rigby, Peter C.
    Thanh Van Nguyen
    Karanfil, Mark
    Nguyen, Tien N.
    PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 331 - 333
  • [2] T2API: Synthesizing API Code Usage Templates from English Texts with Statistical Translation
    Thanh Nguyen
    Rigby, Peter C.
    Anh Tuan Nguyen
    Karanfil, Mark
    Nguyen, Tien N.
    FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, : 1013 - 1017
  • [3] Aligning Turkish and English parallel texts for statistical machine translation
    El-Kahlout, ID
    Oflazer, K
    COMPUTER AND INFORMATION SCIENCES - ISCIS 2005, PROCEEDINGS, 2005, 3733 : 616 - 625
  • [4] Learning translation templates from bilingual texts
    Guvenir, HA
    Cicekli, I
    ARTIFICIAL INTELLIGENCE: METHODOLOGY, SYSTEMS, APPLICATIONS, 1996, 35 : 3 - 11
  • [5] COLONIAL ANDEAN TEXTS IN ENGLISH TRANSLATION
    Figueroa, Luis Millones
    LATIN AMERICAN RESEARCH REVIEW, 2009, 44 (02) : 181 - 192
  • [6] Statistical API Completion Based on Code Relevance Mining
    Wang, Chengpeng
    Yang, Yixiao
    Liu, Han
    Kang, Le
    2019 IEEE 2ND INTERNATIONAL WORKSHOP ON MINING AND ANALYZING INTERACTION HISTORIES (MAINT '19), 2019, : 7 - 13
  • [7] TEXTS FOR TRANSLATION INTO ENGLISH - FRENCH AND ENGLISH - JOLY,A, OKELLY,D
    DIERICKX, J
    REVUE BELGE DE PHILOLOGIE ET D HISTOIRE, 1994, 72 (03): : 737 - 738
  • [8] Thinking English Translation: Analysing and Translating English Source Texts
    Demir, Cuneyt
    EURASIAN JOURNAL OF APPLIED LINGUISTICS, 2019, 5 (01): : 181 - 184
  • [9] Migrating Code with Statistical Machine Translation
    Anh Tuan Nguyen
    Tung Thanh Nguyen
    Nguyen, Tien N.
    36TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE COMPANION 2014), 2014, : 544 - 547
  • [10] TEXTS AND CONTEXTS OF TRANSLATION - A DUTCH CLASSIC IN ENGLISH
    VANDERAUWERA, R
    DISPOSITIO-REVISTA HISPANICA DE SEMIOTICA LITERARIA, 1982, 7 (19-2): : 111 - 121