Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running example3 #22

Open
mvvardhan opened this issue Jul 31, 2018 · 1 comment
Open

Error while running example3 #22

mvvardhan opened this issue Jul 31, 2018 · 1 comment

Comments

@mvvardhan
Copy link

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

@aimaaonline
Copy link

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants