Simple implementation of N-Gram, tf-idf and Cosine similarity in Python

前端 未结 5 1712
逝去的感伤
逝去的感伤 2020-11-28 17:58

I need to compare documents stored in a DB and come up with a similarity score between 0 and 1.

The method I need to use has to be very simple. Implementing a vanil

5条回答
  •  时光说笑
    2020-11-28 18:32

    If you are interested, I've done tutorial series (Part I and Part II) talking about tf-idf and using the Scikits.learn (sklearn) Python module.

    Part 3 has cosine similarity.

提交回复
热议问题