Skip to content

Instantly share code, notes, and snippets.

@hweller1
Created November 9, 2023 17:19
Show Gist options
  • Save hweller1/19ba9eeb86d20236dc916462bcce74a3 to your computer and use it in GitHub Desktop.
Save hweller1/19ba9eeb86d20236dc916462bcce74a3 to your computer and use it in GitHub Desktop.
def compute_overlap(exact_result_set: List, approx_result_set: List) -> float:
# each result set is a list of urls, order not considered
return len(exact_result_set.intersection(set(approx_result_set)) / len(set(exact_result_set))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment