Skip to content

Commit

Permalink
corrected score assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Aug 19, 2024
1 parent aa33481 commit 995669f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/oaklib/implementations/semsimian/semsimian_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def all_by_all_pairwise_similarity(
minimum_resnik_threshold=min_ancestor_information_content,
# predicates=set(predicates) if predicates else None,
)

logging.info("Post-processing results from semsimian")
for term1_key, values in all_results.items():
for term2_key, result in values.items():
Expand All @@ -228,15 +229,15 @@ def all_by_all_pairwise_similarity(
iter(ancestor_set)
), # TODO: Change this: gets first element of the set
)
sim.jaccard_similarity = jaccard
sim.ancestor_information_content = resnik
sim.phenodigm_score = phenodigm_score

else:
sim = TermPairwiseSimilarity(
subject_id=term1_key, object_id=term2_key, ancestor_id=OWL_THING
)
sim.jaccard_similarity = 0
sim.ancestor_information_content = 0
sim.jaccard_similarity = jaccard if jaccard is not None else 0.0
sim.ancestor_information_content = resnik if resnik is not None else 0.0
sim.phenodigm_score = phenodigm_score if phenodigm_score is not None else 0.0

yield sim

def termset_pairwise_similarity(
Expand Down

0 comments on commit 995669f

Please sign in to comment.