Jaccard Text Similarity

def get_jaccard_sim(str1, str2): 
    a = set(str1.split()) 
    b = set(str2.split())
    c = a.intersection(b)
    return float(len(c)) / (len(a) + len(b) - len(c))
content1 = "AI is our friend and it has been friendly"
content2 = "AI and humans have always been friendly"

sim = get_jaccard_sim(content1, content2)

print(sim)
0.3333333333333333