Skip to content

Commit

Permalink
fixed a bug in the semantic module when using the new ontology
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosalatino committed Jul 30, 2019
1 parent f7e8f17 commit 96ea777
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classifier/semanticmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 96ea777

Please sign in to comment.