Skip to content

Commit

Permalink
adjust order of term extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Oct 8, 2024
1 parent 8863bc8 commit fbcfbb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ir_axioms/axiom/term_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def preference(
document1: RankedDocument,
document2: RankedDocument
):
query_terms = context.term_set(query)
document1_terms = context.term_set(document1)
document2_terms = context.term_set(document2)
query_terms = context.term_set(query)

return strictly_greater(
self.average_similarity(document1_terms, query_terms),
Expand Down Expand Up @@ -63,10 +63,11 @@ def preference(
is non-deterministic if there are multiple equally most similar pairs.
"""

query_terms = context.term_set(query)
document1_terms = context.term_set(document1)
document2_terms = context.term_set(document2)
document_terms = document1_terms | document2_terms
query_terms = context.term_set(query)

non_query_terms = document_terms - query_terms

most_similar_terms = self.most_similar_pair(
Expand Down

0 comments on commit fbcfbb6

Please sign in to comment.