ipvikas commited on
Commit
997b1af
1 Parent(s): 33bdc2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -172,8 +172,8 @@ import re, string, unicodedata
172
  import wikipedia as wk #pip install wikipedia
173
  from collections import defaultdict
174
 
175
- def wikipedia_data(user_response):
176
- reg_ex = re.search('from wikipedia (.*)', user_response)#tell me about
177
  try:
178
  if reg_ex:
179
  topic = reg_ex.group(1)
@@ -206,10 +206,10 @@ def get_response(input_text):
206
  if tag == intent["tag"]:
207
  return random.choice(intent['responses'])
208
  else:
209
- if "From Wikipedia" in sentence:
210
- if sentence:
211
- robo_response = wikipedia_data(user_response)
212
- return robo_response
213
 
214
 
215
  title = "WeASK: ChatBOT"
 
172
  import wikipedia as wk #pip install wikipedia
173
  from collections import defaultdict
174
 
175
+ def wikipedia_data(sentence):
176
+ reg_ex = re.search('from wikipedia (.*)', sentence)#tell me about
177
  try:
178
  if reg_ex:
179
  topic = reg_ex.group(1)
 
206
  if tag == intent["tag"]:
207
  return random.choice(intent['responses'])
208
  else:
209
+ #if "From Wikipedia" in sentence:
210
+ #if sentence:
211
+ robo_response = wikipedia_data(sentence)
212
+ return robo_response
213
 
214
 
215
  title = "WeASK: ChatBOT"