DEV Community

Discussion on: Compare documents similarity using Python | NLP

Collapse
 
r13technewbie profile image
R13TechNewbie

Thanks for making the tutorial, coderasha. I currently following your tutorial, and I think I found some typo in this part :

tf_idf = gensim.models.TfidfModel(corpus)
for doc in tfidf[corpus]:
print([[mydict[id], np.around(freq, decimals=2)] for id, freq in doc])

probably the "mydict" variable is typo, so I changed to "dictionary" based on previous line declaration and the code works.

Please verify this, Thanks

Collapse
 
thedevtimeline profile image
Rashid

Oh, I see. Yes, there is a typo in that part. Thank you for your attention :)