Skip to content

Commit

Permalink
Merge pull request #5 from Louis-Mozart/retrieval_eval_incomplete
Browse files Browse the repository at this point in the history
Minor error fixed
  • Loading branch information
Louis-Mozart authored Dec 18, 2024
2 parents d97ae68 + 9d7f23f commit 16cbfe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/retrieval_with_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import seaborn as sns

parser = argparse.ArgumentParser()
parser.add_argument('--cache_size_ratios', type=list, default=[.1], help="cache size is proportional to num_concepts, cache size = k * num_concepts")
parser.add_argument('--path_kg', type=str, default=["KGs/Family/father.owl"])
parser.add_argument('--cache_size_ratios', type=list, default=[.1, .2, .4, .8, 1.], help="cache size is proportional to num_concepts, cache size = k * num_concepts")
parser.add_argument('--path_kg', type=str, default=["KGs/Family/family.owl", "KGs/Family/father.owl"])
parser.add_argument('--path_kge', type=list, default=None)
parser.add_argument('--name_reasoner', type=str, default='EBR', choices=["EBR",'HermiT', 'Pellet', 'JFact', 'Openllet'])
parser.add_argument('--eviction_strategy', type=str, default='LRU', choices=['LIFO', 'FIFO', 'LRU', 'MRU', 'RP'])
Expand Down
5 changes: 1 addition & 4 deletions ontolearn/semantic_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def initialize_cache(self, func, path_onto, third, All_individuals, handle_restr
for negated_cls in tqdm(negated_class_concepts, desc=f"Adding Complement concepts"):
# Compute and store complement
negated_cls_str = owl_expression_to_dl(negated_cls)
cached = self.cache.get(concept_str) or None
cached = self.cache.get(negated_cls_str.split("¬")[-1])
if cached is None:
cached = func(negated_cls, path_onto, third)
neg = All_individuals - cached
Expand Down Expand Up @@ -554,6 +554,3 @@ def run_cache(path_kg:str, path_kge:str, cache_size:int, name_reasoner:str, evic
'avg_jaccard_reas': f"{sum(Avg_jaccard_reas) / len(Avg_jaccard_reas):.3f}",
'strategy': eviction
}, D



0 comments on commit 16cbfe7

Please sign in to comment.