deduplication jaccard python

Solutions on MaxInterview for deduplication jaccard python by the best coders in the world

showing results for - "deduplication jaccard python"
Emmanuel
07 Jan 2021
1s1 = "what's the flight time from Berlin to Helsinki?"
2s2 = "how long does it take to fly from Berlin to Helsinki?"
3
4shingles1 = set([s1[max(0, i-4):i] for i in range(4, len(s1) + 1)])
5shingles2 = set([s2[max(0, i-4):i] for i in range(4, len(s2) + 1)])
6
7len(shingles1 & shingles2) / len(shingles1 | shingles2)
8
similar questions
queries leading to this page
deduplication jaccard python