Можно получить среднее сходство между двумя списками слов, используя предтренированную модель word2vec (GoogleNews-vectors-absolute300) или wordnet:
dic_email=['email','e-mail','address'] # dictionary of email contain word similar to email
dic_identity=['name','first','last','identity','forename']
lista = ['fullname','user'] # fullname is similar to name
listb = ['phone','number']
resa=lista.compare(dic_email,dic_identity) #just an example of my function compare
restb=listb.compare(dic_email,dic_identity)
print('the percent of similarity is :'+resa)
print('the percent of similarity is :'+resb)
Результат должен быть:
the percent of similarity is : [('dic_identity',0.8),('dic_email',0.0)] # i just gives a rondom percent to explain lista is similar to dic_identity beacause fullname is similar to the item in dic_identity
the percent of similarity is : [('dic_identity',0.0),('dic_email',0.0)]