gensim.matutils.jaccard(vec1, vec2)[source]

A distance metric between bags of words representation. Returns 1 minus the intersection divided by union, where union is the sum of the size of the two bags. If it is not a bag of words representation, the union and intersection is calculated in the traditional manner. Returns a value in range <0,1> where values closer to 0 mean less distance and thus higher similarity.