Path-based Similarity: It is a similarity measure that finds the distance that is the length of the shortest path between two synsets.
Leacock Chordorow (LCH) : It is a similarity measure which is an extended version of Path-based similarity as it incorporates the depth of the taxonomy. Therefore, it is the negative log of the shortest path (spath) between two concepts (synset_1 and synset_2) divided by twice the total depth of the taxonomy (D) as defined in fig below.
Code #1 : Introducing Synsets.
hello name : hello.n.01 selling name : selling.n.01
Code #2 : Path Similarity
Code #3 : Leacock Chordorow (LCH) Similarity
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course