def jaccard intersection return float len len len len

1
2
3
def jaccard(a, b):
c = a.intersection(b)
return float(len(c)) / (len(a) + len(b) - len(c))