awacke1 commited on
Commit
e1f11d0
1 Parent(s): b40a7cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -53,13 +53,14 @@ def get_wiki_article(topic):
53
  choices = [x for x in e.options if ('disambiguation' not in x) and ('All pages' not in x) and (x!=topic)]
54
  s = random.choice(choices)
55
  p = wikipedia.page(s)
56
- saved = AIMemory(p, s)
57
  return p.content, p.url
58
 
59
  def get_answer(topic, question):
60
  w_art, w_url=get_wiki_article(topic)
61
  qa = {'question': question, 'context': w_art}
62
  res = nlp(qa)
 
63
  return res['answer'], w_url, {'confidence':res['score']}
64
 
65
 
 
53
  choices = [x for x in e.options if ('disambiguation' not in x) and ('All pages' not in x) and (x!=topic)]
54
  s = random.choice(choices)
55
  p = wikipedia.page(s)
56
+ saved = AIMemory(p.content, p.url)
57
  return p.content, p.url
58
 
59
  def get_answer(topic, question):
60
  w_art, w_url=get_wiki_article(topic)
61
  qa = {'question': question, 'context': w_art}
62
  res = nlp(qa)
63
+ saved = AIMemory(res['answer'], w_url)
64
  return res['answer'], w_url, {'confidence':res['score']}
65
 
66