hamedbabaeigiglou commited on
Commit
c5ea1ee
·
verified ·
1 Parent(s): e41b376

cosmetic changes to docs

Browse files
Files changed (1) hide show
  1. README.md +48 -22
README.md CHANGED
@@ -9,19 +9,13 @@ tags:
9
  - law
10
  pretty_name: Law
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;">Law 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 law domain encompasses ontologies that systematically represent the complex structures and interrelations of legal concepts, processes, regulations, and rights. This domain is pivotal in knowledge representation as it facilitates the formalization and interoperability of legal information, enabling precise reasoning and decision-making across diverse legal systems. By capturing the intricacies of legal language and practice, these ontologies support the automation and enhancement of legal services and research.
@@ -34,7 +28,7 @@ The law domain encompasses ontologies that systematically represent the complex
34
  ## Dataset Files
35
  Each ontology directory contains the following files:
36
  1. `<ontology_id>.<format>` - The original ontology file
37
- 2. `term_typings.json` - Dataset of term to type mappings
38
  3. `taxonomies.json` - Dataset of taxonomic relations
39
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
40
  5. `<ontology_id>.rst` - Documentation describing the ontology
@@ -42,15 +36,31 @@ Each ontology directory contains the following files:
42
  ## Usage
43
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
44
 
45
- ```python
46
- from ontolearner.ontology import Wine
47
- from ontolearner.utils.train_test_split import train_test_split
48
- from ontolearner.learner_pipeline import LearnerPipeline
 
 
 
 
 
 
 
 
 
 
49
 
50
- ontology = Wine()
51
- ontology.load() # Automatically downloads from Hugging Face
 
 
 
 
 
52
 
53
- # Extract the dataset
 
54
  data = ontology.extract()
55
 
56
  # Split into train and test sets
@@ -58,10 +68,10 @@ train_data, test_data = train_test_split(data, test_size=0.2)
58
 
59
  # Create a learning pipeline (for RAG-based learning)
60
  pipeline = LearnerPipeline(
61
- task="term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
62
- retriever_id="sentence-transformers/all-MiniLM-L6-v2",
63
- llm_id="mistralai/Mistral-7B-Instruct-v0.1",
64
- hf_token="your_huggingface_token" # Only needed for gated models
65
  )
66
 
67
  # Train and evaluate
@@ -73,5 +83,21 @@ results, metrics = pipeline.fit_predict_evaluate(
73
  )
74
  ```
75
 
76
- For more detailed examples, see the [OntoLearner documentation](https://ontolearner.readthedocs.io/).
77
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  - law
10
  pretty_name: Law
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;">Law 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 law domain encompasses ontologies that systematically represent the complex structures and interrelations of legal concepts, processes, regulations, and rights. This domain is pivotal in knowledge representation as it facilitates the formalization and interoperability of legal information, enabling precise reasoning and decision-making across diverse legal systems. By capturing the intricacies of legal language and practice, these ontologies support the automation and enhancement of legal services and research.
 
28
  ## Dataset Files
29
  Each ontology directory contains the following files:
30
  1. `<ontology_id>.<format>` - The original ontology file
31
+ 2. `term_typings.json` - A Dataset of term-to-type mappings
32
  3. `taxonomies.json` - Dataset of taxonomic relations
33
  4. `non_taxonomic_relations.json` - Dataset of non-taxonomic relations
34
  5. `<ontology_id>.rst` - Documentation describing the ontology
 
36
  ## Usage
37
  These datasets are intended for ontology learning research and applications. Here's how to use them with OntoLearner:
38
 
39
+ First of all, install the `OntoLearner` library via PiP:
40
+
41
+ ```bash
42
+ pip install ontolearner
43
+ ```
44
+
45
+ **How to load an ontology or LLM4OL Paradigm tasks datasets?**
46
+ ``` python
47
+ from ontolearner import CopyrightOnto
48
+
49
+ ontology = CopyrightOnto()
50
+
51
+ # Load an ontology.
52
+ ontology.load()
53
 
54
+ # Load (or extract) LLMs4OL Paradigm tasks datasets
55
+ data = ontology.extract()
56
+ ```
57
+
58
+ **How use the loaded dataset for LLM4OL Paradigm task settings?**
59
+ ``` python
60
+ from ontolearner import CopyrightOnto, LearnerPipeline, train_test_split
61
 
62
+ ontology = CopyrightOnto()
63
+ ontology.load()
64
  data = ontology.extract()
65
 
66
  # Split into train and test sets
 
68
 
69
  # Create a learning pipeline (for RAG-based learning)
70
  pipeline = LearnerPipeline(
71
+ task = "term-typing", # Other options: "taxonomy-discovery" or "non-taxonomy-discovery"
72
+ retriever_id = "sentence-transformers/all-MiniLM-L6-v2",
73
+ llm_id = "mistralai/Mistral-7B-Instruct-v0.1",
74
+ hf_token = "your_huggingface_token" # Only needed for gated models
75
  )
76
 
77
  # Train and evaluate
 
83
  )
84
  ```
85
 
86
+ For more detailed documentation, see the [![Documentation](https://img.shields.io/badge/Documentation-ontolearner.readthedocs.io-blue)](https://ontolearner.readthedocs.io)
87
+
88
+
89
+ ## Citation
90
+
91
+ If you find our work helpful, feel free to give us a cite.
92
+
93
+
94
+ ```bibtex
95
+ @inproceedings{babaei2023llms4ol,
96
+ title={LLMs4OL: Large language models for ontology learning},
97
+ author={Babaei Giglou, Hamed and D’Souza, Jennifer and Auer, S{\"o}ren},
98
+ booktitle={International Semantic Web Conference},
99
+ pages={408--427},
100
+ year={2023},
101
+ organization={Springer}
102
+ }
103
+ ```