Skip to content

Commit 3136ce0

Browse files
committed
🐛 change parent child pairs keys in test
1 parent 1714672 commit 3136ce0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ontolearner/learner/retriever.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def __init__(self, base_retriever: Any = AutoRetriever(), top_k: int = 5, batch_
2222
self.retriever = base_retriever
2323
self.top_k = top_k
2424
self._is_term_typing_fit = False
25-
self._is_taxonomy_discovery_fit = False
2625
self._batch_size = batch_size
2726

2827
def load(self, model_id: str = "sentence-transformers/all-MiniLM-L6-v2"):
@@ -64,9 +63,9 @@ def _taxonomy_discovery(self, data: Any, test: bool = False) -> Optional[Any]:
6463
if test:
6564
self._retriever_fit(data=data)
6665
candidates_lst = self._retriever_predict(data=data, top_k=self.top_k + 1)
67-
taxonomic_pairs = [{"parent": query, "child": candidate}
66+
taxonomic_pairs = [{"parent": candidate, "child": query}
6867
for query, candidates in zip(data, candidates_lst)
69-
for candidate in candidates if candidate != query]
68+
for candidate in candidates if candidate.lower() != query.lower()]
7069
return taxonomic_pairs
7170
else:
7271
warnings.warn("No requirement for fiting the taxonomy discovery model, the predict module will use the input data to do the fit as well.")

0 commit comments

Comments
 (0)