I searched on the net the different measures of text similarity. And I found many algorithms concerning this issue and there are classified into many categories such:

  1. Token-Based Measure: Tf-idf, Euclidean, Manhattan, overlap coefficient, matching coefficient, cosine, etc.
  2. Character-based: Levenshtein, Hamming, Jaro-Winkler, Jaro, etc.
  3. Q-gram: Jaccard, dice coefficient, etc.
  4. Mixed Measures: Monge-Elkan, Soft-tfidf

and other categories. In the article Similarity Measures for Title Matching they use different similarity measures and compare the results. But such a result they mention that Levenshtein could be one of the best algorithm for text similarities. Is it efficient with long sentences?

  • $\begingroup$ I don't see how this question is answerable, since you haven't told us how efficient you need it to be or what you'd consider to be efficient. Also, before asking, you should just try it. How long is an English sentence going to be? A few dozen words? It should be super-fast for that. $\endgroup$ – D.W. Nov 24 '17 at 4:26
  • $\begingroup$ @D.W. I want to implement a similarity algorithm for a database query, thus I should choose the suitable algorithm for text similarity and there are some efficient for character changes and other efficient for token changes.I want to choose the one that matchs the character change and token change.Then I found based on some articles that Levenshtein may be the suitable one. The length of the sentence depends on what the user enters.But we can say that the max length will be 5 words. $\endgroup$ – Slim Nov 24 '17 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.