Ontolearn is an open-source software library for structured machine learning in Python. Ontolearn includes modules for processing knowledge bases, inductive logic programming and ontology. engineering.
Project description
Ontolearn
Ontolearn is an open-source software library for structured machine learning in Python. Ontolearn includes modules for processing knowledge bases, representation learning, inductive logic programming and ontology engineering.
Current Installation
1) git clone https://github.com/dice-group/OntoPy.git
2) conda create -n temp python=3.6.2 # Or be sure that your have Python => 3.6.
3) conda activate temp
4) python ontolearn/setup.py install
# After you receive this Finished processing dependencies for OntoPy==0.0.1
5) python -c "import ontolearn"
Later Installation
pip install ontolearn
Usage
from ontolearn import KnowledgeBase, Refinement
kb = KnowledgeBase(path='data/family-benchmark_rich_background.owl')
rho = Refinement(kb)
for refs in enumerate(rho.refine(kb.thing)):
print(refs)
from ontolearn import KnowledgeBase,SampleConceptLearner
kb = KnowledgeBase(path='data/family-benchmark_rich_background.owl')
model = SampleConceptLearner(knowledge_base=kb,iter_bound=100,verbose=False)
p = {'http://www.benchmark.org/family#F10M173', 'http://www.benchmark.org/family#F10M183'}
n = {'http://www.benchmark.org/family#F1F5', 'http://www.benchmark.org/family#F1F7'}
model.predict(pos=p, neg=n)
model.show_best_predictions(top_n=10)
from ontolearn import KnowledgeBase,SampleConceptLearner
from ontolearn.metrics import F1, PredictiveAccuracy, CELOEHeuristic,DLFOILHeuristic
kb = KnowledgeBase(path='data/family-benchmark_rich_background.owl')
p = {'http://www.benchmark.org/family#F10M173', 'http://www.benchmark.org/family#F10M183'}
n = {'http://www.benchmark.org/family#F1F5', 'http://www.benchmark.org/family#F1F7'}
model = SampleConceptLearner(knowledge_base=kb,
quality_func=F1(),
terminate_on_goal=True,
heuristic_func=DLFOILHeuristic(),
iter_bound=100,
verbose=False)
model.predict(pos=p, neg=n)
model.show_best_predictions(top_n=10)
######################################################################
model = SampleConceptLearner(knowledge_base=kb,
quality_func=PredictiveAccuracy(),
terminate_on_goal=True,
heuristic_func=CELOEHeuristic(),
iter_bound=100,
verbose=False)
model.predict(pos=p, neg=n)
model.show_best_predictions(top_n=10)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ontolearn-0.0.2.tar.gz
(82.4 kB
view hashes)
Built Distribution
ontolearn-0.0.2-py3-none-any.whl
(28.8 kB
view hashes)
Close
Hashes for ontolearn-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22077240d209b33443af62c8c19b8be48c16f08caabba1a61179151ca9b5c4f4 |
|
MD5 | 804b422a1470e5695c0bcf25c0db7f8c |
|
BLAKE2b-256 | 798e9e2950e09a9b7b168975e65b53170b98909e40a157d0e7b54c41fc9c3823 |