API Usage Constraint Knowledge Construction Based on Large Language Model

Application Programming Interface (API) usage constraints are the conditions or restrictions that developers must follow when invoking APIs to ensure correct usage and prevent misuse. API documentation is an important tool for extracting these constraints. Existing Natural Language Processing (NLP)-...

Celý popis

Uložené v:
Podrobná bibliografia
Vydané v:Ji suan ji gong cheng Ročník 51; číslo 8; s. 74 - 85
Hlavný autor: LIU Genhao, ZHANG Neng, ZHENG Zibin
Médium: Journal Article
Jazyk:Chinese
English
Vydavateľské údaje: Editorial Office of Computer Engineering 15.08.2025
Predmet:
ISSN:1000-3428
On-line prístup:Získať plný text
Tagy: Pridať tag
Žiadne tagy, Buďte prvý, kto otaguje tento záznam!
Popis
Shrnutí:Application Programming Interface (API) usage constraints are the conditions or restrictions that developers must follow when invoking APIs to ensure correct usage and prevent misuse. API documentation is an important tool for extracting these constraints. Existing Natural Language Processing (NLP)-based methods for extracting API usage constraints often rely on syntactic patterns, but their ability to handle complex coordinated sentences and impose strict requirements on syntactic structures is limited. To address these issues, this paper proposes an API usage constraint knowledge extraction method based on Large Language Model (LLM), referred to as AUCK. AUCK first preprocesses Java API documentation and extracts sentences containing API usage constraints. It then summarizes the syntactic patterns of coordinated sentences and designs corresponding cases to guide a LLM to decompose coordinated sentences into simple sentences. Finally, it summarizes the syntactic patterns of triplets and design cases to guide the LLM in extracting API usage constraint triplets. Experimental results on Java API documentation show that AUCK achieves an accuracy of 92.23% and recall of 93.14%, significantly outperforming existing methods, including DRONE (accuracy: 80.61%, recall: 86.81%), the mainstream triplet extraction tool OpenIE (accuracy: 76.92%, recall: 52.63%), and the large language model ChatGPT-3.5 (accuracy: 82.23%, recall: 67.71%). In addition, the application of AUCK to Android and Python API documentation verifies its good transferability.
ISSN:1000-3428
DOI:10.19678/j.issn.1000-3428.0070623