hamedbabaeigiglou commited on
Commit
0b11ff9
·
verified ·
1 Parent(s): 94cab87

cosmetic changes to docs

Browse files
Files changed (1) hide show
  1. README.md +56 -20
README.md CHANGED
@@ -9,19 +9,13 @@ tags:
9
  - geography
10
  pretty_name: Geography
11
  ---
12
- <div>
13
  <img src="https://raw.githubusercontent.com/sciknoworg/OntoLearner/main/images/logo.png" alt="OntoLearner"
14
  style="display: block; margin: 0 auto; width: 500px; height: auto;">
15
  <h1 style="text-align: center; margin-top: 1em;">Geography Domain Ontologies</h1>
 
16
  </div>
17
 
18
- <div align="center">
19
-
20
- [![GitHub](https://img.shields.io/badge/GitHub-OntoLearner-blue?logo=github)](https://github.com/sciknoworg/OntoLearner)
21
- [![PyPI](https://img.shields.io/badge/PyPI-OntoLearner-blue?logo=pypi)](https://pypi.org/project/OntoLearner/)
22
- [![Documentation](https://img.shields.io/badge/Docs-ReadTheDocs-blue)](https://ontolearner.readthedocs.io/benchmarking/benchmark.html)
23
-
24
- </div>
25
 
26
  ## Overview
27
  The geography domain encompasses the structured representation and analysis of spatial, environmental, and geopolitical phenomena, focusing on the precise modeling of physical locations, territorial boundaries, and place names. This domain is pivotal in knowledge representation as it facilitates the integration and interoperability of geographic information across diverse systems, enabling advanced spatial reasoning and decision-making. By providing a formal framework for understanding the complex relationships between geographic entities, this domain supports a wide range of applications, from urban planning to environmental monitoring.
@@ -42,18 +36,42 @@ Each ontology directory contains the following files:
42
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
43
  5. `<ontology_id>.rst` - Documentation describing the ontology
44
 
 
 
 
 
 
 
 
 
45
  ## Usage
46
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
47
 
48
- ```python
49
- from ontolearner.ontology import Wine
50
- from ontolearner.utils.train_test_split import train_test_split
51
- from ontolearner.learner_pipeline import LearnerPipeline
 
 
 
 
 
 
 
52
 
53
- ontology = Wine()
54
- ontology.load() # Automatically downloads from Hugging Face
55
 
56
- # Extract the dataset
 
 
 
 
 
 
 
 
 
57
  data = ontology.extract()
58
 
59
  # Split into train and test sets
@@ -61,10 +79,10 @@ train_data, test_data = train_test_split(data, test_size=0.2)
61
 
62
  # Create a learning pipeline (for RAG-based learning)
63
  pipeline = LearnerPipeline(
64
- task="term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
65
- retriever_id="sentence-transformers/all-MiniLM-L6-v2",
66
- llm_id="mistralai/Mistral-7B-Instruct-v0.1",
67
- hf_token="your_huggingface_token" # Only needed for gated models
68
  )
69
 
70
  # Train and evaluate
@@ -76,5 +94,23 @@ results, metrics = pipeline.fit_predict_evaluate(
76
  )
77
  ```
78
 
79
- For more detailed examples, see the [OntoLearner documentation](https://ontolearner.readthedocs.io/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
 
9
  - geography
10
  pretty_name: Geography
11
  ---
12
+ <div align="center">
13
  <img src="https://raw.githubusercontent.com/sciknoworg/OntoLearner/main/images/logo.png" alt="OntoLearner"
14
  style="display: block; margin: 0 auto; width: 500px; height: auto;">
15
  <h1 style="text-align: center; margin-top: 1em;">Geography Domain Ontologies</h1>
16
+ <a href="https://github.com/sciknoworg/OntoLearner"><img src="https://img.shields.io/badge/GitHub-OntoLearner-blue?logo=github" /></a>
17
  </div>
18
 
 
 
 
 
 
 
 
19
 
20
  ## Overview
21
  The geography domain encompasses the structured representation and analysis of spatial, environmental, and geopolitical phenomena, focusing on the precise modeling of physical locations, territorial boundaries, and place names. This domain is pivotal in knowledge representation as it facilitates the integration and interoperability of geographic information across diverse systems, enabling advanced spatial reasoning and decision-making. By providing a formal framework for understanding the complex relationships between geographic entities, this domain supports a wide range of applications, from urban planning to environmental monitoring.
 
36
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
37
  5. `<ontology_id>.rst` - Documentation describing the ontology
38
 
39
+ ## Dataset Files
40
+ Each ontology directory contains the following files:
41
+ 1. `<ontology_id>.<format>` - The original ontology file
42
+ 2. `term_typings.json` - A Dataset of term-to-type mappings
43
+ 3. `taxonomies.json` - Dataset of taxonomic relations
44
+ 4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
45
+ 5. `<ontology_id>.rst` - Documentation describing the ontology
46
+
47
  ## Usage
48
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
49
 
50
+ First of all, install the `OntoLearner` library via PiP:
51
+
52
+ ```bash
53
+ pip install ontolearner
54
+ ```
55
+
56
+ **How to load an ontology or LLM4OL Paradigm tasks datasets?**
57
+ ``` python
58
+ from ontolearner import GEO
59
+
60
+ ontology = GEO()
61
 
62
+ # Load an ontology.
63
+ ontology.load()
64
 
65
+ # Load (or extract) LLMs4OL Paradigm tasks datasets
66
+ data = ontology.extract()
67
+ ```
68
+
69
+ **How use the loaded dataset for LLM4OL Paradigm task settings?**
70
+ ``` python
71
+ from ontolearner import GEO, LearnerPipeline, train_test_split
72
+
73
+ ontology = GEO()
74
+ ontology.load()
75
  data = ontology.extract()
76
 
77
  # Split into train and test sets
 
79
 
80
  # Create a learning pipeline (for RAG-based learning)
81
  pipeline = LearnerPipeline(
82
+ task = "term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
83
+ retriever_id = "sentence-transformers/all-MiniLM-L6-v2",
84
+ llm_id = "mistralai/Mistral-7B-Instruct-v0.1",
85
+ hf_token = "your_huggingface_token" # Only needed for gated models
86
  )
87
 
88
  # Train and evaluate
 
94
  )
95
  ```
96
 
97
+ For more detailed documentation, see the [![Documentation](https://img.shields.io/badge/Documentation-ontolearner.readthedocs.io-blue)](https://ontolearner.readthedocs.io)
98
+
99
+
100
+ ## Citation
101
+
102
+ If you find our work helpful, feel free to give us a cite.
103
+
104
+
105
+ ```bibtex
106
+ @inproceedings{babaei2023llms4ol,
107
+ title={LLMs4OL: Large language models for ontology learning},
108
+ author={Babaei Giglou, Hamed and D’Souza, Jennifer and Auer, S{\"o}ren},
109
+ booktitle={International Semantic Web Conference},
110
+ pages={408--427},
111
+ year={2023},
112
+ organization={Springer}
113
+ }
114
+ ```
115
+
116