{"id":50125521,"url":"https://github.com/sciknoworg/OntoLearner","last_synced_at":"2026-06-09T11:00:54.925Z","repository":{"id":282912426,"uuid":"913867999","full_name":"sciknoworg/OntoLearner","owner":"sciknoworg","description":"OntoLearner: A Modular Python Library for Ontology Learning with LLMs https://pypi.org/project/OntoLearner/","archived":false,"fork":false,"pushed_at":"2026-05-04T17:34:49.000Z","size":9935,"stargazers_count":36,"open_issues_count":9,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-04T18:36:21.962Z","etag":null,"topics":["benchmarking","ontologies","ontology-engineering","ontology-learning","python-library","text2onto"],"latest_commit_sha":null,"homepage":"https://ontolearner.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sciknoworg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-08T14:04:31.000Z","updated_at":"2026-05-04T17:34:52.000Z","dependencies_parsed_at":"2026-01-04T08:02:13.107Z","dependency_job_id":null,"html_url":"https://github.com/sciknoworg/OntoLearner","commit_stats":null,"previous_names":["sciknoworg/ontolearner"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/sciknoworg/OntoLearner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciknoworg%2FOntoLearner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciknoworg%2FOntoLearner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciknoworg%2FOntoLearner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciknoworg%2FOntoLearner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sciknoworg","download_url":"https://codeload.github.com/sciknoworg/OntoLearner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciknoworg%2FOntoLearner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarking","ontologies","ontology-engineering","ontology-learning","python-library","text2onto"],"created_at":"2026-05-23T20:00:20.646Z","updated_at":"2026-06-09T11:00:54.912Z","avatar_url":"https://github.com/sciknoworg.png","language":"Python","funding_links":[],"categories":["Python","Machine Learning"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/sciknoworg/OntoLearner/main/images/logo.png\" alt=\"OntoLearner Logo\"/\u003e\n\u003c/div\u003e\n\n\u003ch3 align=\"center\"\u003eOntoLearner: A Modular Python Library for Ontology Learning with LLMs\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI version](https://badge.fury.io/py/OntoLearner.svg)](https://badge.fury.io/py/OntoLearner)\n[![PyPI Downloads](https://static.pepy.tech/badge/ontolearner)](https://pepy.tech/projects/ontolearner)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Hugging Face Collection](https://img.shields.io/badge/🤗HuggingFace-Collection-blue)](https://huggingface.co/collections/SciKnowOrg/)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![Documentation Status](https://app.readthedocs.org/projects/ontolearner/badge/)](https://ontolearner.readthedocs.io/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](MAINTENANCE.md)\n[![DOI](https://zenodo.org/badge/913867999.svg)](https://doi.org/10.5281/zenodo.15399773)\n\n\u003c/div\u003e\n\n---\n\n**OntoLearner** is a modular and extensible Python library for **ontology learning** powered by Large Language Models (LLMs). It provides a unified framework covering the full workflow — from loading and modularizing ontologies to training, predicting, and evaluating learner models across multiple ontology learning tasks.\n\nThe framework is built around three core components:\n\n- 🧩 **Ontologizers** — load, parse, and modularize ontologies from 150+ ready-to-use sources across 20+ domains.\n- 📋 **Learning Tasks** — support for Term Typing, Taxonomy Discovery, Non-Taxonomic Relation Extraction, and Text2Onto.\n- 🤖 **Learner Models** — plug-and-play LLM, Retriever, and RAG-based learners with a consistent `fit → predict → evaluate` interface.\n\n---\n\n## 🧪 Installation\n\nOntoLearner is available on [PyPI](https://pypi.org/project/OntoLearner/) and can be installed with `pip`:\n\n```bash\npip install ontolearner\n```\n\nVerify the installation:\n\n```python\nimport ontolearner\n\nprint(ontolearner.__version__)\n```\n\n\u003e For additional installation options (e.g., from source, with optional dependencies), see the [Installation Guide](https://ontolearner.readthedocs.io/installation.html).\n\n---\n\n## 🔗 Essential Resources\n\n| Resource | Description |\n|:---------|:------------|\n| **[📚 Documentation](https://ontolearner.readthedocs.io/)** | Full documentation website. |\n| **[🤗 Datasets on Hugging Face](https://huggingface.co/collections/SciKnowOrg/ontolearner-benchmarking-6823bcd051300c210b7ef68a)** | Curated, machine-readable ontology datasets. |\n| **[🚀 Quickstart](https://ontolearner.readthedocs.io/quickstart.html)** | Get started in minutes. |\n| **[🕸️ Learning Tasks](https://ontolearner.readthedocs.io/learning_tasks/learning_tasks.html)** | Term Typing, Taxonomy Discovery, Relation Extraction, and Text2Onto. |\n| **[🧠 Learner Models](https://ontolearner.readthedocs.io/learners/llm.html)** | LLM, Retriever, and RAG-based learner models. |\n| **[📖 Ontologies Documentation](https://ontolearner.readthedocs.io/benchmarking/benchmark.html)** | Browse 150+ benchmark ontologies across 20+ domains. |\n| **[🧩 Ontologizer Guide](https://ontolearner.readthedocs.io/ontologizer/ontology_modularization.html)** | How to modularize and preprocess ontologies. |\n| **[📊 Metrics Dashboard](https://huggingface.co/spaces/SciKnowOrg/OntoLearner-Benchmark-Metrics)** | Explore benchmark ontology metrics and complexity scores. |\n\n---\n\n## ✨ Key Features\n\n- **150+ Ontologizers** across 20+ domains (biology, medicine, agriculture, chemistry, law, finance, and more).\n- **Multiple learning tasks**: Term Typing, Taxonomy Discovery, Non-Taxonomic Relation Extraction, and Text2Onto.\n- **Three learner paradigms**: LLM-based, Retriever-based, and Retrieval-Augmented Generation (RAG).\n- **Hugging Face integration**: auto-download ontologies and models directly from the Hub.\n- **Unified API**: consistent `fit → predict → evaluate` interface across all learners.\n- **LearnerPipeline**: end-to-end pipeline in a single call.\n- **Extensible**: easily plug in custom ontologies, learners, or retrievers.\n- **Text2Onto generation**: synthetic document generation now uses a direct `transformers` backend with ontology-aware context enrichment.\n\n---\n\n## 🚀 Quick Tour\n\n### Loading an Ontology\n\nLoad any of the 150+ built-in ontologies and extract task datasets in just a few lines:\n\n```python\nfrom ontolearner import Wine\n\n# Initialize an ontologizer\nontology = Wine()\n\n# Auto-download from Hugging Face and load\nontology.load()\n\n# Extract learning task datasets\ndata = ontology.extract()\n\n# Inspect ontology metadata\nprint(ontology)\n```\n\n\u003e Explore [150+ ready-to-use ontologies](https://ontolearner.readthedocs.io/benchmarking/benchmark.html) or learn [how to work with ontologizers](https://ontolearner.readthedocs.io/ontologizer/ontology_modularization.html).\n\n---\n\n### Retriever-Based Learner\n\nUse a dense retriever model to perform non-taxonomic relation extraction:\n\n```python\nfrom ontolearner import AutoRetrieverLearner, AgrO, train_test_split, evaluation_report\n\n# Load and extract ontology data\nontology = AgrO()\nontology.load()\nontological_data = ontology.extract()\n\n# Split into train and test sets\ntrain_data, test_data = train_test_split(ontological_data, test_size=0.2, random_state=42)\n\n# Initialize and load a retriever-based learner\ntask = 'non-taxonomic-re'\nret_learner = AutoRetrieverLearner(top_k=5)\nret_learner.load(model_id='sentence-transformers/all-MiniLM-L6-v2')\n\n# Fit on training data and predict on test data\nret_learner.fit(train_data, task=task)\npredicts = ret_learner.predict(test_data, task=task)\n\n# Evaluate predictions\ntruth = ret_learner.tasks_ground_truth_former(data=test_data, task=task)\nmetrics = evaluation_report(y_true=truth, y_pred=predicts, task=task)\nprint(metrics)\n```\n\nOther available learners:\n- [LLM-Based Learner](https://ontolearner.readthedocs.io/learners/llm.html)\n- [Retriever-Based Learner](https://ontolearner.readthedocs.io/learners/retrieval.html)\n- [RAG-Based Learner](https://ontolearner.readthedocs.io/learners/rag.html)\n- [LLMs4OL Challenge Learners](https://ontolearner.readthedocs.io/learners/llms4ol.html)\n\n---\n\n### LearnerPipeline\n\n`LearnerPipeline` consolidates the entire workflow — initialization, training, prediction, and evaluation — into a single call:\n\n```python\nfrom ontolearner import LearnerPipeline, AgrO, train_test_split\n\n# Load ontology and extract data\nontology = AgrO()\nontology.load()\n\ntrain_data, test_data = train_test_split(\n    ontology.extract(),\n    test_size=0.2,\n    random_state=42\n)\n\n# Initialize the pipeline with a dense retriever\npipeline = LearnerPipeline(\n    retriever_id='sentence-transformers/all-MiniLM-L6-v2',\n    batch_size=10,\n    top_k=5\n)\n\n# Run: fit → predict → evaluate\noutputs = pipeline(\n    train_data=train_data,\n    test_data=test_data,\n    evaluate=True,\n    task='non-taxonomic-re'\n)\n\nprint(\"Metrics:\", outputs['metrics'])\nprint(\"Elapsed time:\", outputs['elapsed_time'])\n```\n\n---\n\n## ⭐ Contribution\n\nWe welcome contributions of all kinds — bug reports, new features, documentation improvements, or new ontologies!\n\nPlease review our guidelines before getting started:\n- [CONTRIBUTING.md](CONTRIBUTING.md) — contribution guidelines\n- [MAINTENANCE.md](MAINTENANCE.md) — ongoing maintenance notes\n\nFor bugs or questions, please open an issue in the [GitHub Issue Tracker](https://github.com/sciknoworg/OntoLearner/issues).\n\n---\n\n## 💡 Acknowledgements\n\nIf OntoLearner is useful in your research or work, please consider citing one of our publications:\n\n```bibtex\n@inproceedings{babaei2023llms4ol,\n  title     = {LLMs4OL: Large Language Models for Ontology Learning},\n  author    = {Babaei Giglou, Hamed and D'Souza, Jennifer and Auer, S{\\\"o}ren},\n  booktitle = {International Semantic Web Conference},\n  pages     = {408--427},\n  year      = {2023},\n  organization = {Springer}\n}\n```\n\n```bibtex\n@software{babaei_giglou_2025_15399783,\n  author    = {Babaei Giglou, Hamed and D'Souza, Jennifer and Aioanei, Andrei\n               and Mihindukulasooriya, Nandana and Auer, Sören},\n  title     = {OntoLearner: A Modular Python Library for Ontology Learning with LLMs},\n  month     = may,\n  year      = 2025,\n  publisher = {Zenodo},\n  version   = {v1.3.0},\n  doi       = {10.5281/zenodo.15399783},\n  url       = {https://doi.org/10.5281/zenodo.15399783}\n}\n```\n\n---\n\nThis software is archived on Zenodo under [![DOI](https://zenodo.org/badge/913867999.svg)](https://doi.org/10.5281/zenodo.15399773) and is licensed under [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciknoworg%2FOntoLearner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciknoworg%2FOntoLearner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciknoworg%2FOntoLearner/lists"}