ontolearn.utils
Ontolearn utils.
Submodules
Package Contents
Functions
|
Setup logging. |
|
Compute F1-score of a concept |
|
|
|
|
|
|
|
|
|
|
|
Balance given two sets through sampling without replacement. |
|
Path leads a folder containing embeddings in csv format. |
|
|
|
|
Read a text file containing IRIs of Named Individuals (one per line) and return the content as a set of OWL |
|
Read a text file containing IRIs of OWL Named Classes (one per line) and return the content as a set of OWL |
Attributes
- ontolearn.utils.setup_logging(config_file='ontolearn/logging.conf')[source]
Setup logging.
- Parameters:
config_file (str) – Filepath for logs.
- ontolearn.utils.compute_f1_score(individuals, pos, neg) float [source]
Compute F1-score of a concept
- ontolearn.utils.Factory
- ontolearn.utils.DEFAULT_FMT = 'Func:{name} took {elapsed:0.8f}s'
- ontolearn.utils.flag_for_performance = False
- ontolearn.utils.balanced_sets(a: set, b: set) Tuple[Set, Set] [source]
Balance given two sets through sampling without replacement. Returned sets have the same length. @param a: @param b: @return:
- ontolearn.utils.read_csv(path) None | pandas.DataFrame [source]
Path leads a folder containing embeddings in csv format. indexes correspond subjects or predicates or objects in n-triple. @param path: @return:
- ontolearn.utils.read_individuals_file(file: str) Set[owlapy.owl_individual.OWLNamedIndividual] [source]
Read a text file containing IRIs of Named Individuals (one per line) and return the content as a set of OWL Named Individuals
- Parameters:
file – path to the text file with the IRIs of the named individuals
- Returns:
set of OWLNamedIndividual with these IRIs
- ontolearn.utils.read_named_classes_file(file: str) Set[owlapy.class_expression.OWLClass] [source]
Read a text file containing IRIs of OWL Named Classes (one per line) and return the content as a set of OWL Classes
- Parameters:
file – path to the text file with the IRIs of the classes
- Returns:
set of OWLNamedIndividual with these IRIs