hamedbabaeigiglou commited on
Commit
c760361
·
verified ·
1 Parent(s): c97c384

cosmetic changes to docs

Browse files
Files changed (1) hide show
  1. README.md +49 -21
README.md CHANGED
@@ -9,19 +9,13 @@ tags:
9
  - arts_and_humanities
10
  pretty_name: Arts And Humanities
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;">Arts And Humanities 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 arts and humanities domain encompasses ontologies that systematically represent and categorize the diverse aspects of human cultural expression, including music, visual arts, historical artifacts, and broader humanistic studies. This domain plays a crucial role in knowledge representation by providing structured frameworks that facilitate the organization, retrieval, and analysis of cultural and artistic information, thereby enhancing interdisciplinary research and digital scholarship. Through precise modeling of complex cultural phenomena, these ontologies contribute to the preservation and dissemination of human heritage in the digital age.
@@ -38,7 +32,7 @@ The arts and humanities domain encompasses ontologies that systematically repres
38
  ## Dataset Files
39
  Each ontology directory contains the following files:
40
  1. `<ontology_id>.<format>` - The original ontology file
41
- 2. `term_typings.json` - Dataset of term to type mappings
42
  3. `taxonomies.json` - Dataset of taxonomic relations
43
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
44
  5. `<ontology_id>.rst` - Documentation describing the ontology
@@ -46,15 +40,31 @@ Each ontology directory contains the following files:
46
  ## Usage
47
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
48
 
49
- ```python
50
- from ontolearner.ontology import Wine
51
- from ontolearner.utils.train_test_split import train_test_split
52
- from ontolearner.learner_pipeline import LearnerPipeline
 
 
 
 
 
 
 
53
 
54
- ontology = Wine()
55
- ontology.load() # Automatically downloads from Hugging Face
56
 
57
- # Extract the dataset
 
 
 
 
 
 
 
 
 
58
  data = ontology.extract()
59
 
60
  # Split into train and test sets
@@ -62,10 +72,10 @@ train_data, test_data = train_test_split(data, test_size=0.2)
62
 
63
  # Create a learning pipeline (for RAG-based learning)
64
  pipeline = LearnerPipeline(
65
- task="term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
66
- retriever_id="sentence-transformers/all-MiniLM-L6-v2",
67
- llm_id="mistralai/Mistral-7B-Instruct-v0.1",
68
- hf_token="your_huggingface_token" # Only needed for gated models
69
  )
70
 
71
  # Train and evaluate
@@ -77,5 +87,23 @@ results, metrics = pipeline.fit_predict_evaluate(
77
  )
78
  ```
79
 
80
- For more detailed examples, see the [OntoLearner documentation](https://ontolearner.readthedocs.io/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
 
9
  - arts_and_humanities
10
  pretty_name: Arts And Humanities
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;">Arts And Humanities 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 arts and humanities domain encompasses ontologies that systematically represent and categorize the diverse aspects of human cultural expression, including music, visual arts, historical artifacts, and broader humanistic studies. This domain plays a crucial role in knowledge representation by providing structured frameworks that facilitate the organization, retrieval, and analysis of cultural and artistic information, thereby enhancing interdisciplinary research and digital scholarship. Through precise modeling of complex cultural phenomena, these ontologies contribute to the preservation and dissemination of human heritage in the digital age.
 
32
  ## Dataset Files
33
  Each ontology directory contains the following files:
34
  1. `<ontology_id>.<format>` - The original ontology file
35
+ 2. `term_typings.json` - A Dataset of term-to-type mappings
36
  3. `taxonomies.json` - Dataset of taxonomic relations
37
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
38
  5. `<ontology_id>.rst` - Documentation describing the ontology
 
40
  ## Usage
41
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
42
 
43
+ First of all, install the `OntoLearner` library via PiP:
44
+
45
+ ```bash
46
+ pip install ontolearner
47
+ ```
48
+
49
+ **How to load an ontology or LLM4OL Paradigm tasks datasets?**
50
+ ``` python
51
+ from ontolearner import ChordOntology
52
+
53
+ ontology = ChordOntology()
54
 
55
+ # Load an ontology.
56
+ ontology.load()
57
 
58
+ # Load (or extract) LLMs4OL Paradigm tasks datasets
59
+ data = ontology.extract()
60
+ ```
61
+
62
+ **How use the loaded dataset for LLM4OL Paradigm task settings?**
63
+ ``` python
64
+ from ontolearner import ChordOntology, LearnerPipeline, train_test_split
65
+
66
+ ontology = ChordOntology()
67
+ ontology.load()
68
  data = ontology.extract()
69
 
70
  # Split into train and test sets
 
72
 
73
  # Create a learning pipeline (for RAG-based learning)
74
  pipeline = LearnerPipeline(
75
+ task = "term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
76
+ retriever_id = "sentence-transformers/all-MiniLM-L6-v2",
77
+ llm_id = "mistralai/Mistral-7B-Instruct-v0.1",
78
+ hf_token = "your_huggingface_token" # Only needed for gated models
79
  )
80
 
81
  # Train and evaluate
 
87
  )
88
  ```
89
 
90
+ For more detailed documentation, see the [![Documentation](https://img.shields.io/badge/Documentation-ontolearner.readthedocs.io-blue)](https://ontolearner.readthedocs.io)
91
+
92
+
93
+ ## Citation
94
+
95
+ If you find our work helpful, feel free to give us a cite.
96
+
97
+
98
+ ```bibtex
99
+ @inproceedings{babaei2023llms4ol,
100
+ title={LLMs4OL: Large language models for ontology learning},
101
+ author={Babaei Giglou, Hamed and D’Souza, Jennifer and Auer, S{\"o}ren},
102
+ booktitle={International Semantic Web Conference},
103
+ pages={408--427},
104
+ year={2023},
105
+ organization={Springer}
106
+ }
107
+ ```
108
+
109