hamedbabaeigiglou commited on
Commit
35293d4
·
verified ·
1 Parent(s): 10236f1

cosmetic changes to docs

Browse files
Files changed (1) hide show
  1. README.md +71 -4
README.md CHANGED
@@ -9,10 +9,11 @@ tags:
9
  - chemistry
10
  pretty_name: Agricultural
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;">Chemistry Domain Ontologies</h1>
 
16
  </div>
17
 
18
  ## Overview
@@ -40,11 +41,77 @@ The chemistry domain encompasses the structured representation and formalization
40
  ## Dataset Files
41
  Each ontology directory contains the following files:
42
  1. `<ontology_id>.<format>` - The original ontology file
43
- 2. `term_typings.json` - Dataset of term to type mappings
44
  3. `taxonomies.json` - Dataset of taxonomic relations
45
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
46
  5. `<ontology_id>.rst` - Documentation describing the ontology
47
 
 
48
  ## Usage
49
- These datasets are intended for ontology learning research and applications.
50
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  - chemistry
10
  pretty_name: Agricultural
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;">Chemistry 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
  ## Overview
 
41
  ## Dataset Files
42
  Each ontology directory contains the following files:
43
  1. `<ontology_id>.<format>` - The original ontology file
44
+ 2. `term_typings.json` - A Dataset of term-to-type mappings
45
  3. `taxonomies.json` - Dataset of taxonomic relations
46
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
47
  5. `<ontology_id>.rst` - Documentation describing the ontology
48
 
49
+
50
  ## Usage
51
+ These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
52
+
53
+ First of all, install the `OntoLearner` library via PiP:
54
+
55
+ ```bash
56
+ pip install ontolearner
57
+ ```
58
+
59
+ **How to load an ontology or LLM4OL Paradigm tasks datasets?**
60
+ ``` python
61
+ from ontolearner import AFO
62
+
63
+ ontology = AFO()
64
+
65
+ # Load an ontology.
66
+ ontology.load()
67
+
68
+ # Load (or extract) LLMs4OL Paradigm tasks datasets
69
+ data = ontology.extract()
70
+ ```
71
+
72
+ **How use the loaded dataset for LLM4OL Paradigm task settings?**
73
+ ``` python
74
+ from ontolearner import AFO, LearnerPipeline, train_test_split
75
+
76
+ ontology = AFO()
77
+ ontology.load()
78
+ data = ontology.extract()
79
+
80
+ # Split into train and test sets
81
+ train_data, test_data = train_test_split(data, test_size=0.2)
82
+
83
+ # Create a learning pipeline (for RAG-based learning)
84
+ pipeline = LearnerPipeline(
85
+ task = "term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
86
+ retriever_id = "sentence-transformers/all-MiniLM-L6-v2",
87
+ llm_id = "mistralai/Mistral-7B-Instruct-v0.1",
88
+ hf_token = "your_huggingface_token" # Only needed for gated models
89
+ )
90
+
91
+ # Train and evaluate
92
+ results, metrics = pipeline.fit_predict_evaluate(
93
+ train_data=train_data,
94
+ test_data=test_data,
95
+ top_k=3,
96
+ test_limit=10
97
+ )
98
+ ```
99
+
100
+ For more detailed documentation, see the [![Documentation](https://img.shields.io/badge/Documentation-ontolearner.readthedocs.io-blue)](https://ontolearner.readthedocs.io)
101
+
102
+
103
+ ## Citation
104
+
105
+ If you find our work helpful, feel free to give us a cite.
106
+
107
+
108
+ ```bibtex
109
+ @inproceedings{babaei2023llms4ol,
110
+ title={LLMs4OL: Large language models for ontology learning},
111
+ author={Babaei Giglou, Hamed and D’Souza, Jennifer and Auer, S{\"o}ren},
112
+ booktitle={International Semantic Web Conference},
113
+ pages={408--427},
114
+ year={2023},
115
+ organization={Springer}
116
+ }
117
+ ```