iamviveksrk commited on
Commit
b9ebf82
1 Parent(s): f916292

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -9,6 +9,7 @@ from haystack.pipelines import ExtractiveQAPipeline
9
  from haystack.nodes import FARMReader
10
  import time
11
  import joblib
 
12
 
13
  @st.cache(hash_funcs={"builtins.SwigPyObject": lambda _: None},allow_output_mutation=True)
14
  def create_pipeline():
@@ -30,7 +31,15 @@ def set_state_if_absent(key, value):
30
  if key not in st.session_state:
31
  st.session_state[key] = value
32
 
33
- set_state_if_absent("question", 'Applications of AI and deep learning')
 
 
 
 
 
 
 
 
34
  set_state_if_absent("results", None)
35
 
36
  def reset_results(*args):
 
9
  from haystack.nodes import FARMReader
10
  import time
11
  import joblib
12
+ from random import choice
13
 
14
  @st.cache(hash_funcs={"builtins.SwigPyObject": lambda _: None},allow_output_mutation=True)
15
  def create_pipeline():
 
31
  if key not in st.session_state:
32
  st.session_state[key] = value
33
 
34
+ queries = ['Methods of orthodontics',
35
+ 'What are some effects of climate change?',
36
+ 'Factors of global warming',
37
+ 'Effects of Covid-19 Virus on the economy',
38
+ 'Applications of AI and deep learning',
39
+ 'Sexually transmitted diseases and their prevalence',
40
+ 'Cryptography and cryptology']
41
+
42
+ set_state_if_absent("question", choice(queries))
43
  set_state_if_absent("results", None)
44
 
45
  def reset_results(*args):