Discussion on: Compare documents similarity using Python | NLP

r13technewbie profile image

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

coderasha profile image
coderasha Author

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