AutoOntic: Automatically Inducing Ontologies from Text to Build High-Quality Knowledge Graphs

AutoOntic automatically induces lightweight ontologies from text, canonicalizing types and relations and mining hierarchies and constraints to significantly improve graph structuredness and retrieval accuracy.
AutoOntic is a pipeline that automatically builds lightweight ontologies from text, aiming to solve the problem that mainstream LLM-based schema-free extraction can only produce flat graph structures. By canonicalizing open-vocabulary entity types and relations, inducing a hierarchy over the canonicalized types, and mining relation-level domain/range constraints, it provides a structural skeleton for knowledge graphs. Its hierarchy induction adopts a strategy of prioritization plus LLM-arbitrated local parent-child checks, and supports dynamic reassignment of existing parent-child links when new types are inserted. On Text2KGBench, over 90% of the induced endpoint types are semantically aligned with reference classes; on the downstream MINE task, the knowledge graph organized with the AutoOntic ontology achieves a retrieval accuracy of 88%. The code is open-sourced, providing a reproducible automated path for domain knowledge graph construction.
The quality of a knowledge graph (KG) directly determines the effectiveness of retrieval-augmented generation (RAG) built on top of it. However, current mainstream schema-free extraction pipelines powered by large language models (LLMs) often produce only "flat" graph structures: after deduplication, entities and relations lack type hierarchies and domain/range constraints. To address this pain point, researchers propose AutoOntic—a pipeline that automatically builds ontologies from text. By canonicalizing open-vocabulary entity types and relations, inducing type hierarchies, and mining relation-level constraints, it significantly improves the structuredness of knowledge graphs.

Why Is Automatic Ontology Induction Needed?
In traditional knowledge graph construction, the ontology plays the role of a "skeleton," defining the type system of concepts, their properties, and relation constraints. But the reality is that building ontologies entirely by hand is costly and hard to scale, while purely schema-free LLM extraction, though flexible, loses structural information. AutoOntic seeks a balance between the two: it automatically "learns" a lightweight ontology from text and then uses it to guide graph canonicalization.
Specifically, AutoOntic's core tasks consist of three parts: canonicalizing open-vocabulary entity types and relations, inducing a hierarchy over the canonicalized types, and mining relation-level domain and range constraints (i.e., the subject/object type restrictions of a relation).
Open Vocabulary Extraction means not predefining a fixed set of entity types and relation types, but instead letting the model directly identify entities and relations of arbitrary types from text. This approach is highly flexible and can cover newly emerging concepts in a domain, but the cost is that extraction results are highly fragmented: types with the same semantics may be expressed as multiple different strings (e.g., "人物," "人," "个人"), and relation predicates lack unified constraints. AutoOntic's canonicalization step is precisely designed to resolve this lexical diversity, mapping open vocabulary onto a set of canonicalized types and relations, thereby providing an operable symbolic foundation for subsequent hierarchy induction and constraint mining.
Ontology in knowledge engineering refers to an explicit, formal specification of a conceptualization, typically including classes, properties, relations, and their hierarchies and constraints. A lightweight ontology generally contains only type hierarchies and domain/range constraints, without involving complex axiom systems. What AutoOntic builds is exactly this kind of lightweight ontology: it does not pursue complete logical reasoning capability, but rather provides a structural skeleton for the knowledge graph, so that entity types have a hierarchy to rely on and relations have subject/object type restrictions to follow, thereby improving the consistency and queryability of the graph.
Hierarchy Induction: Letting Types "Find Their Own Place"
Hierarchy induction is AutoOntic's key innovation. It adopts a strategy of "prioritization plus local verification": first, it uses relation-argument profiles in the corpus to prioritize types, and then, through LLM-arbitrated parent-child relationship checks, it places each type at an appropriate position in the hierarchy. You may not have noticed that newly inserted types can trigger the reassignment of existing parent-child links, thereby dynamically optimizing the hierarchy structure.
This dynamic adjustment mechanism enables the hierarchy to adapt to new concepts emerging in the text, avoiding the rigidity of static ontologies. The resulting hierarchy not only constrains the entity deduplication process, but also provides a foundation for the subsequent induction of relation-level domain/range constraints.
Relation-Argument Profiles refer to the statistical aggregation of the subject and object entity types connected by each relation in the corpus, forming the distributional characteristics of that relation at the type level. For example, the subject of the relation "出生于" (born in) is mostly a person-name entity, and the object is mostly a location entity. Such profiles can reflect the "positional importance" of a type in the relation network: if a type frequently appears in the subject or object position of multiple relations, it usually means it is at a higher level of abstraction or has stronger connectivity. AutoOntic uses this signal to prioritize types, first placing high-priority types into the hierarchy and then gradually inserting lower-priority types, thereby reducing the number of local verifications and improving the efficiency and stability of hierarchy induction.
Domain and Range Constraints are the basic constraints at the relation level in an ontology: the domain specifies which types the relation's subject should belong to, and the range specifies which types the relation's object should belong to. For example, the domain of "导演了" (directed) can be constrained to "人物" (person), and the range to "电影" (film). In schema-free extraction, the two ends of a relation can connect to entities of any type, leading to a large number of semantically unreasonable edges in the graph. After inducing the type hierarchy, AutoOntic uses the hierarchy information to mine domain/range constraints for each relation, thereby filtering out relation instances with mismatched types during the extraction stage or post-processing stage, and improving the semantic consistency of the graph.
Evaluation Results: Success in Both Semantic Alignment and Retrieval Accuracy
To evaluate the quality of the induced ontology, the researchers introduced an evaluation protocol based on a reference ontology, comparing the induced types with reference domain and range classes and categorizing them as exact match, broader, narrower, or irrelevant. On the Wikidata-TekGen and DBpedia-WebNLG subsets of Text2KGBench, over 90% of the endpoint types induced by AutoOntic are semantically aligned with reference classes (under both LLM backbones), with about half being exact matches and most of the remaining differences related to granularity.
On the downstream task MINE, using the ontology constructed by AutoOntic to organize the knowledge graph achieved a retrieval accuracy of 88%. This result shows that automatically induced ontologies can effectively improve graph retrieval accuracy, thereby providing more reliable support for RAG systems.
Text2KGBench is a benchmark for evaluating the ability to construct knowledge graphs from text. It contains multiple subsets based on different knowledge bases (such as Wikidata and DBpedia) and provides reference ontologies for measuring the structural quality of extraction results. Among them, Wikidata-TekGen and DBpedia-WebNLG correspond to different text sources and knowledge base schemas. The researchers compared the types induced by AutoOntic with the classes in the reference ontologies on these subsets to evaluate the degree of semantic alignment.
MINE is an evaluation task for knowledge graph retrieval, examining whether a system can accurately retrieve relevant entities or facts from a graph given a query. After organizing the graph with the AutoOntic ontology, the retrieval accuracy reached 88%, indicating that structured type hierarchies and relation constraints can effectively narrow the retrieval space and reduce noise caused by type ambiguity, thereby providing more precise knowledge support for downstream RAG systems. This result also indirectly validates the positive correlation between ontology quality and the downstream usability of the graph.
Open Source and Outlook
AutoOntic's code has been open-sourced on GitHub (https://github.com/screemix/AutoOntic), providing a reproducible and extensible tool for the field of knowledge graph construction. For teams that need to build domain knowledge graphs, AutoOntic offers an automated path from unstructured text to structured ontologies. In the future, how to more tightly integrate ontology induction with graph completion and reasoning will be a direction worth exploring.
One-line Summary
AutoOntic automatically induces lightweight ontologies from text, canonicalizing types and relations and mining hierarchies and constraints to significantly improve graph structuredness and retrieval accuracy.
Paragraph Summary
AutoOntic is a pipeline that automatically builds lightweight ontologies from text, aiming to solve the problem that mainstream LLM-based schema-free extraction can only produce flat graph structures. By canonicalizing open-vocabulary entity types and relations, inducing a hierarchy over the canonicalized types, and mining relation-level domain/range constraints, it provides a structural skeleton for knowledge graphs. Its hierarchy induction adopts a strategy of prioritization plus LLM-arbitrated local parent-child checks, and supports dynamic reassignment of existing parent-child links when new types are inserted. On Text2KGBench, over 90% of the induced endpoint types are semantically aligned with reference classes; on the downstream MINE task, the knowledge graph organized with the AutoOntic ontology achieves a retrieval accuracy of 88%. The code is open-sourced, providing a reproducible automated path for domain knowledge graph construction.
Related articles

Programmers in the AI Era: How Deep Should You Learn Legacy Tech?
How should programmers transform under AI's impact? How deep should legacy tech be learned? Drawing on a Bilibili creator's share, this breaks down the levels of embracing AI, the shift from process-driven to project-driven learning, and how lower technical barriers affect junior and mid-level roles.

OpenAI Releases GPT-6.2 Dual Models Astra and Sol, API Price Cut by 20%
OpenAI releases GPT-6.2 Astra and Sol, with Astra's API price cut 20% to $8/$40 per million tokens and ranking second on the Artificial Analysis Intelligence Index. This article analyzes the dual-model strategy, price-cut impact, and developer selection advice.

Perplexity Computer Launches Multiagent: 16 AI Agents Cross-Validate Each Other
Perplexity launches Multiagent mode for Computer: a lead agent orchestrates up to 16 sub-agents on Claude, GPT, and Gemini, sharing findings and cross-validating work with effort above Ultra.