From 19f8bd4d9cd6bd8bf516698b3384443c4a7bc430 Mon Sep 17 00:00:00 2001 From: Luke Friedrichs Date: Thu, 5 Dec 2024 11:37:58 +0100 Subject: [PATCH] Revert "caching disabled by default" This reverts commit 9a5492e87fce2857a6dc68038b5c031d03a2997c. --- owlapy/owl_neural_reasoners/owl_neural_reasoner.py | 2 +- tests/test_neural_reasoner_accuracy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/owlapy/owl_neural_reasoners/owl_neural_reasoner.py b/owlapy/owl_neural_reasoners/owl_neural_reasoner.py index c91af49..c1dddde 100644 --- a/owlapy/owl_neural_reasoners/owl_neural_reasoner.py +++ b/owlapy/owl_neural_reasoners/owl_neural_reasoner.py @@ -21,7 +21,7 @@ def is_valid_entity(text_input: str): class OWLNeuralReasoner(AbstractNeuralReasoner): """ OWL Neural Reasoner uses a neural link predictor to retrieve instances of an OWL Class Expression""" - def __init__(self, path_of_kb: str = None, path_neural_embedding: str = None, gamma: float = 0.25, max_cache_size: int = 0): + def __init__(self, path_of_kb: str = None, path_neural_embedding: str = None, gamma: float = 0.25, max_cache_size: int = 2**20): assert gamma is None or 0 <= gamma <= 1, "Confidence threshold (gamma) must be in the range [0, 1]." self.gamma = gamma self._prediction_cache = OrderedDict() diff --git a/tests/test_neural_reasoner_accuracy.py b/tests/test_neural_reasoner_accuracy.py index 68d8cb2..d63d4ed 100644 --- a/tests/test_neural_reasoner_accuracy.py +++ b/tests/test_neural_reasoner_accuracy.py @@ -24,7 +24,7 @@ def test_retrieval_performance(): seed = 42 ratio_sample_object_prop = 1.0 ratio_sample_nc = 1.0 - num_nominals = 5 + num_nominals = 10 min_jaccard_similarity = 1.0 min_f1_score = 1.0