Created
January 10, 2020 08:07
-
-
Save mohdsanadzakirizvi/b48cb8ae8db62869d12dab0ca664ce85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from indicnlp.script import indic_scripts as isc | |
from indicnlp.script import phonetic_sim as psim | |
c1='क' | |
c2='ख' | |
c3='भ' | |
lang='hi' | |
print('Similarity between {} and {}'.format(c1,c2)) | |
print(psim.cosine( | |
isc.get_phonetic_feature_vector(c1,lang), | |
isc.get_phonetic_feature_vector(c2,lang) | |
)) | |
print(u'Similarity between {} and {}'.format(c1,c3)) | |
print(psim.cosine( | |
isc.get_phonetic_feature_vector(c1,lang), | |
isc.get_phonetic_feature_vector(c3,lang) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment