How do we ignore the order of letters in calculating Levenshtein distance?

191 views Asked by At

This question is not new and i have seen some form of explanation here and here. Both methods described performing N grams (bigrams mostly) calculations on the terms of query 1 and query 2 and then finding the cosine similarity.

I was hoping for a clarification based on what i understand:

I need to get the TF-IDF score for all bigrams in query 1 and query 2 and then use that score to calculate the cosine similarity score. If this is so, would anyone be able to kindly write a simple python code for clearer explanation?

0

There are 0 answers