From 96ea7772815cd96f86b0015a9002c25778334300 Mon Sep 17 00:00:00 2001 From: angelosalatino Date: Tue, 30 Jul 2019 19:08:15 +0100 Subject: [PATCH] fixed a bug in the semantic module when using the new ontology --- classifier/semanticmodule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classifier/semanticmodule.py b/classifier/semanticmodule.py index 2efba45..59ef4b6 100644 --- a/classifier/semanticmodule.py +++ b/classifier/semanticmodule.py @@ -162,7 +162,7 @@ def classify_semantic(self): sim = topic_item["sim_w"] - if m >= min_similarity: + if m >= min_similarity and topic in self.cso["topics_wu"]: if topic in found_topics: @@ -227,6 +227,8 @@ def classify_semantic(self): unique_topics = {} for tp,topic in found_topics.items(): prim_label = self.get_primary_label(tp,self.cso["primary_labels_wu"]) + if prim_label == 'network_structures': + print('Here I found you:', tp) if prim_label in unique_topics: if unique_topics[prim_label] < topic["score"]: unique_topics[prim_label] = topic["score"]