In other words, given two sets Q and P, where Q={qw 1 ,qw 2 ,…,qw n } and P={pw 1 ,pw 2 ,…,pw m }, the similarity between Q and P is given by 1<p<n Argmax m similarity( qw p , pw m ) The function similarity( w 1 , w 2 ) maps the stems of the two words w 1 and w 2 to a similarity measure m representing how semantically related the two words are; similarity( w i , w j )< similarity( w i , w k ) represents the fact that the word w j is less semantically related than w k in respect to the word w i .
similarity=0 if two words are not at all semantically related and similarity=1 if the words are the same.