Abstract
Knowledge graphs (KGs) have the advantage of providing fine-grained detail for question-answering systems. Unfortunately, building a reliable KG is time-consuming and expensive as it requires human intervention. To overcome this issue, we propose a novel framework to automatically construct a KG from unstructured documents that does not require external alignment. We first extract surface-form knowledge tuples from unstructured documents and encode them with contextual information. Entities with similar context semantics are then linked through internal alignment to form a graph structure. This allows us to extract the desired information from multiple documents by traversing the generated KG without a manual process. We examine its performance in retrieval based QA systems by reformulating the WikiMovies and MetaQA datasets into a tuple-level retrieval task. The experimental results show that our method outperforms traditional retrieval methods by a large margin.
Introduction
Knowledge Graphs (KGs) represent the gold standard for precise, interpretable question answering (QA), particularly for tasks requiring "multi-hop" reasoning—the ability to connect disparate facts across multiple documents. However, the construction of high-quality KGs traditionally relies on extensive human annotation or complex pipelines that map text to rigid external schemas like Wikidata. These processes are not only expensive but often result in databases that are outdated by the time they are deployed.
AutoKG addresses this "knowledge bottleneck" by constructing "virtual" knowledge graphs directly from raw, unstructured text. By extracting triples and linking them via contextual BERT embeddings, AutoKG enables state-of-the-art retrieval for complex queries without requiring manual labeling or external database alignment.
Methodology
The AutoKG framework builds its virtual graph through a four-stage pipeline:
- Triple Extraction (OpenIE): The system utilizes Open Information Extraction (OpenIE) to convert sentences into "surface-form" triples:
(subject, relation, object). For instance, the sentence "The Goonies is a film directed by Richard Donner" is decomposed into tuples such as(The Goonies, is, an American film)and(an American film, directed, by Richard Donner). - Contextual Encoding: To resolve polysemy (e.g., distinguishing "Apple" the company from the fruit), each component of the triple is encoded using BERT to generate contextualized embeddings.
- Internal Alignment: Rather than mapping entities to a global unique ID, AutoKG links entities within and across documents if their BERT embeddings exhibit high semantic similarity. An adaptive thresholding mechanism is employed to reduce noise: if an entity has a very strong neighbor, the criteria for linking additional neighbors becomes more stringent.
- Multi-hop Traversal: Retrieval is performed by identifying "seed" entities in a user query and executing a beam search across the virtual graph. The system traverses links to identify the most relevant paths likely to contain the target answer.
Experimental Setup
The performance of AutoKG was evaluated on two primary QA benchmarks, reformulated as tuple-level retrieval tasks:
- WikiMovies: Focused on 1-hop movie-related queries.
- MetaQA: Designed for complex 2-hop and 3-hop reasoning (e.g., "Who directed the movies written by the screenwriter of Inception?"). The underlying corpus consisted of approximately 18,000 movie-related Wikipedia articles.
Key Results
AutoKG demonstrated significant improvements over traditional retrieval models, such as BM25 and Query Likelihood (QL) with RM3 expansion.
As shown in the results table, AutoKG consistently outperformed baselines across all metrics:
- Retrieval Accuracy: On the WikiMovies dataset, AutoKG achieved a Hits@1 of 54.54%, more than doubling the performance of the best baseline (QL+RM3 at 25.71%).
- Multi-hop Reasoning: The advantage was even more pronounced in complex tasks. For MetaQA 3-hop queries, AutoKG reached 25.76% Hits@1, while standard methods struggled to exceed 11.52%.
- Knowledge Coverage: Comparative analysis against the curated OMDb database revealed that AutoKG’s automatically generated graph covered 90% of reachable information, indicating that automated construction can rival manual efforts in comprehensiveness.
Discussion and Future Work
The success of AutoKG highlights the efficacy of "internal alignment"—linking mentions based on local context rather than a fixed global schema. Furthermore, the granularity of retrieving specific triples rather than entire paragraphs proves more efficient for multi-hop tasks where the connecting "bridge" may be a single concise fact.
Despite these gains, limitations remain. OpenIE can introduce "noisy" triples (e.g., unresolved pronouns like "it" or "she"), and while the current traversal jumps between documents via shared entities, more explicit cross-document entity resolution could further strengthen the graph. Future research will focus on integrating these retrieved paths into end-to-end generative models to produce natural language responses.
Summary updated