Siamese-LSTM icon indicating copy to clipboard operation
Siamese-LSTM copied to clipboard

Error while running example3

Open mvvardhan opened this issue 6 years ago • 1 comments

I get the following error when I run python examples/example3.py by uncommenting the line "training=True # Set to false to load weights". Epoch 65 Epoch 65 Update 22840 Cost 0.030776206 Epoch 65 Update 22880 Cost 0.032375146 Epoch 65 Update 22920 Cost 0.024936032 Epoch 65 Update 22960 Cost 0.030370418 Epoch 65 Update 23000 Cost 0.03584883 Epoch 65 Update 23040 Cost 0.042079 Epoch 65 Update 23080 Cost 0.033460055 Epoch 65 Update 23120 Cost 0.023712454 Epoch 65 Update 23160 Cost 0.038346637 epoch took: 45.9180030823 Pre-training done Traceback (most recent call last): File "examples/example3.py", line 14, in train=expand(train) File "/home/projects/Siamese-LSTM/sentences.py", line 146, in expand sa,cnt1=chsyn(i[0],data) File "/home/projects/Siamese-LSTM/sentences.py", line 93, in chsyn if q in cachedStopWords or q.title() in cachedStopWords or q.lower() in cachedStopWords: NameError: global name 'cachedStopWords' is not defined

mvvardhan avatar Jul 31 '18 09:07 mvvardhan

add this line of code in sentences.py

from nltk.corpus import stopwords and in the function def chsyn(s,trn): ----ADD THIS LINE: cachedStopWords=stopwords.words("english")

aimaaonline avatar Aug 03 '18 07:08 aimaaonline