0

I am getting the following error message:

NameError: name 'jarowinkler' is not defined

This error comes from

from similarity.jarowinkler import JaroWinkler

for word in words:
    df[word] = df.Texts.apply(lambda x: jarowinkler.similarity(x, word)) /* here */
    np.where(df[word] > 0.8, df[word], np.nan)

where words = df.Texts.tolist()

Yesterday I ran the code correctly and without any issues. Any idea on the reason why I am getting this error now?

1 Answers1

0
  • Add the following to the script
# call similarity method
jarowinkler = JaroWinkler()
  • Incidentally, this is in the original script, but must have been missed.

Alternatively

df[word] = df.Texts.apply(lambda x: JaroWinkler().similarity(x, word))
Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
  • 1
    Thank you so much Trenton. I accidentally deleted and I was not be able to spot it. –  May 22 '20 at 21:02