# Explore-Construct-Filter: An Automated Framework for Rich and Reliable API Knowledge Graph Construction

arXiv: https://arxiv.org/abs/2502.13412 · HTML: https://mlsanity.com/paper/2502.13412/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 23 of its 49 references that are in the map.
- First posted on arXiv 19 Feb 2025.

## Builds on (most cited first, 23 of 23)

- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [Language Models are Few-Shot Learners](https://mlsanity.com/paper/2005.14165/) (2020)
- [Chain-of-Thought Prompting Elicits Reasoning in Large Language Models](https://mlsanity.com/paper/2201.11903/) (2022)
- [Self-Consistency Improves Chain of Thought Reasoning in Language Models](https://mlsanity.com/paper/2203.11171/) (2022)
- [A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions](https://mlsanity.com/paper/2311.05232/) (2023)
- [From Local to Global: A Graph RAG Approach to Query-Focused Summarization](https://mlsanity.com/paper/2404.16130/) (2024)
- [Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?](https://mlsanity.com/paper/2202.12837/) (2022)
- [Chain-of-Verification Reduces Hallucination in Large Language Models](https://mlsanity.com/paper/2309.11495/) (2023)
- [AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Prompts](https://mlsanity.com/paper/2110.01691/) (2021)
- [Extract, Define, Canonicalize: An LLM-based Framework for Knowledge Graph Construction](https://mlsanity.com/paper/2404.03868/) (2024)
- [PiVe: Prompting with Iterative Verification Improving Graph-based Generative Capability of LLMs](https://mlsanity.com/paper/2305.12392/) (2023)
- [SAC-KG: Exploiting Large Language Models as Skilled Automatic Constructors for Domain Knowledge Graphs](https://mlsanity.com/paper/2410.02811/) (2024)
- [Revisiting, Benchmarking and Exploring API Recommendation: How Far Are We?](https://mlsanity.com/paper/2112.12653/) (2021)
- [From Misuse to Mastery: Enhancing Code Generation with Knowledge-Driven AI Chaining](https://mlsanity.com/paper/2309.15606/) (2023)
- [Can LLMs be Good Graph Judge for Knowledge Graph Construction?](https://mlsanity.com/paper/2411.17388/) (2024)
- [Microservice API Evolution in Practice: A Study on Strategies and Challenges](https://mlsanity.com/paper/2311.08175/) (2023)
- [Let's Discover More API Relations: A Large Language Model-based AI Chain for Unsupervised API Relation Inference](https://mlsanity.com/paper/2311.01266/) (2023)
- [ARCLIN: Automated API Mention Resolution for Unformatted Texts](https://mlsanity.com/paper/2201.01459/) (2022)
- [1+1>2: Programming Know-What and Know-How Knowledge Fusion, Semantic Enrichment and Coherent Application](https://mlsanity.com/paper/2207.05560/) (2022)
- [API Entity and Relation Joint Extraction from Text via Dynamic Prompt-tuned Language Model](https://mlsanity.com/paper/2301.03987/) (2023)
- [Recommending Analogical APIs via Knowledge Graph Embedding](https://mlsanity.com/paper/2308.11422/) (2023)
- [SE Factual Knowledge in Frozen Giant Code Model: A Study on FQN and its Retrieval](https://mlsanity.com/paper/2212.08221/) (2022)
- [Answering Uncertain, Under-Specified API Queries Assisted by Knowledge-Aware Human-AI Dialogue](https://mlsanity.com/paper/2304.14163/) (2023)

## Abstract (arXiv)

The API Knowledge Graph (API KG) is a structured network that models API entities and their relations, providing essential semantic insights for tasks such as API recommendation, code generation, and API misuse detection. However, constructing a knowledge-rich and reliable API KG presents several challenges. Existing schema-based methods rely heavily on manual annotations to design KG schemas, leading to excessive manual overhead. On the other hand, schema-free methods, due to the lack of schema guidance, are prone to introducing noise, reducing the KG's reliability. To address these issues, we propose the Explore-Construct-Filter framework, an automated approach for API KG construction based on large language models (LLMs). This framework consists of three key modules: 1) KG exploration: LLMs simulate the workflow of annotators to automatically design a schema with comprehensive type triples, minimizing human intervention; 2) KG construction: Guided by the schema, LLMs extract instance triples to construct a rich yet unreliable API KG; 3) KG filtering: Removing invalid type triples and suspicious instance triples to construct a rich and reliable API KG. Experimental results demonstrate that our method surpasses the state-of-the-art method, achieving a 25.2% improvement in F1 score. Moreover, the Explore-Construct-Filter framework proves effective, with the KG exploration module increasing KG richness by 133.6% and the KG filtering module improving reliability by 26.6%. Finally, cross-model experiments confirm the generalizability of our framework.
