You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**[📚 OntoLearner Documentation](https://ontolearner.readthedocs.io/)**| Dive into OntoLearner's extensive documentation to explore its modular architecture, including Ontologizers, Learning Tasks, and Learner Models. The documentation provides detailed guides, references, and tutorials to help you get started and make the most of OntoLearner's capabilities. |
44
-
|**[🤗 Datasets on Hugging Face](https://huggingface.co/collections/SciKnowOrg/ontolearner-benchmarking-6823bcd051300c210b7ef68a)**| You can access the curated colloctions of machine-readable ontologies across diverse domains such as agriculture, medicine, social sciences, and more. OntoLearner Benchmarking datasets are optimized for integration into generative AI pipelines, supporting versioning, streaming, and metadata inspection.|
45
-
|**Quick Tour on OntoLearner**[](https://colab.research.google.com/drive/1DuElAyEFzd1vtqTjDEXWcc0zCbiV2Yee?usp=sharing)| Follow this hands-on Colab tutorial to explore the complete OntoLearner workflow—from loading ontologies and extracting structured data, to training RAG models and evaluating performance on benchmark tasks. Ideal for researchers, developers, and educators getting started with ontology-centric machine learning. |
|**[🤗 Datasets on Hugging Face](https://huggingface.co/collections/SciKnowOrg/ontolearner-benchmarking-6823bcd051300c210b7ef68a)**| Access curated, machine-readable ontologies. |
46
+
|**Quick Tour on OntoLearner**[](https://colab.research.google.com/drive/1DuElAyEFzd1vtqTjDEXWcc0zCbiV2Yee?usp=sharing)``version=1.2.1``| OntoLearner hands-on Colab tutorials. |
47
+
|**[🚀 Quickstart](https://ontolearner.readthedocs.io/quickstart.html)**| Get started quickly with OntoLearner’s main features and workflow. |
48
+
|**[🕸️ Learning Tasks](https://ontolearner.readthedocs.io/learning_tasks/learning_tasks.html)**| Explore supported ontology learning tasks like LLMs4OL Paradigm tasks and Text2Onto. ||
49
+
|**[🧠 Learner Models](https://ontolearner.readthedocs.io/learners/llm.html)**| Browse and configure various learner models, including LLMs, Retrieval, or RAG approaches. |
50
+
|**[📚 Ontologies Documentations](https://ontolearner.readthedocs.io/benchmarking/benchmark.html)**| Review benchmark ontologies and datasets used for evaluation and training. |
51
+
|**[🧩 How to work with Ontologizer?](https://ontolearner.readthedocs.io/ontologizer/ontology_modularization.html)**| Learn how to modularize and preprocess ontologies using the Ontologizer module. |
47
52
48
53
## 🚀 Quick Tour
49
54
Get started with OntoLearner in just a few lines of code. This guide demonstrates how to initialize ontologies, load datasets, and train an LLM-assisted learner for ontology engineering tasks.
50
55
51
56
**Basic Usage - Automatic Download from Hugging Face**:
52
57
```python
53
-
from ontolearner.ontologyimport Wine
58
+
from ontolearner import Wine
54
59
55
60
# 1. Initialize an ontologizer from OntoLearner
56
61
ontology = Wine()
57
62
58
-
# 2. Load the ontology automatically from Hugging Face
63
+
# 2. Load the ontology automatically from HuggingFace
59
64
ontology.load()
60
65
61
66
# 3. Extract the learning task dataset
@@ -67,99 +72,84 @@ To see the ontology metadata you can print the ontology:
67
72
print(ontology)
68
73
```
69
74
70
-
**Basic Usage - Manual Download from Hugging Face**:
71
-
```python
72
-
from ontolearner.ontology import Wine
73
-
74
-
# 1. Initialize an ontologizer from OntoLearner
75
-
ontology = Wine()
75
+
Now, explore [150+ ready-to-use ontologies](https://ontolearner.readthedocs.io/benchmarking/benchmark.html) or read on [how to work with ontologizers](https://ontolearner.readthedocs.io/ontologizer/ontology_modularization.html).
76
76
77
-
# 2. Download the ontology from Hugging Face
78
-
ontology.from_huggingface()
79
-
```
77
+
**Learner Models**:
80
78
81
-
**LLM-Based Learning Pipeline**:
82
79
```python
83
-
from ontolearner import ontology, utils, learner
84
-
from ontolearner.evaluation import calculate_term_typing_metrics
80
+
from ontolearner import AutoRetrieverLearner, AgrO, train_test_split, evaluation_report
85
81
86
-
# 1. Load the ontology and extract training data
87
-
onto=ontology.Wine()
88
-
data = onto.extract()
82
+
# 1. Programmatic import of an ontology
83
+
ontology=AgrO()
84
+
ontology.load()
89
85
90
-
# 2. Split into train and test sets
91
-
train_data, test_data = utils.train_test_split(
92
-
data, test_size=0.2, random_state=42
93
-
)
86
+
# 2. Load tasks datasets
87
+
ontological_data = ontology.extract()
94
88
95
-
# 3. Initialize a Retrieval-Augmented Generation (RAG) learner
96
-
retriever = learner.BERTRetrieverLearner()
97
-
llm = learner.AutoLearnerLLM(token="...") # a token required for LLMs with an access
**LearnerPipeline**: The OntoLearner also offers a streamlined `LearnerPipeline` class that simplifies the entire process of initializing, training, predicting, and evaluating a RAG setup into a single call.
129
111
130
-
**LearnerPipeline**:
131
-
```python
132
-
from ontolearner import LearnerPipeline
133
-
from ontolearner import ontology, utils
134
112
135
-
# 1. Load the ontology and extract training data
136
-
onto = ontology.Wine()
137
-
data = onto.extract()
138
113
139
-
# 2. Split into train and test sets
140
-
train_data, test_data = utils.train_test_split(
141
-
data, test_size=0.2, random_state=42
114
+
```python
115
+
# Import core components from the OntoLearner library
116
+
from ontolearner import LearnerPipeline, AgrO, train_test_split
117
+
118
+
# Load the AgrO ontology, which includes structured agricultural knowledge
119
+
ontology = AgrO()
120
+
ontology.load() # Load ontology data (e.g., entities, relations, metadata)
121
+
122
+
# Extract relation instances from the ontology and split them into training and test sets
0 commit comments