edjdhug3 commited on
Commit
f3bca26
·
1 Parent(s): b66e441

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -71,19 +71,22 @@ class Chatbot:
71
 
72
  def run_google_search(self, query):
73
  search = GoogleSerperAPIWrapper()
74
- search.run(query)
75
 
76
  if __name__ == "__main__":
77
  chatbot = Chatbot()
78
  data = chatbot.load_data()
79
  docs = chatbot.split_documents(data)
80
  retriever = chatbot.create_embeddings(docs)
81
- qa = chatbot.create_qa_model(retriever)
 
82
 
83
  st.title('Chatbot Trained on Indian Exam Articles')
84
  st.header("Hi!! How Can I Help You ?")
85
 
86
- query = st.text_input('> ')
87
  result = qa({'query': query})
88
  st.write(result['result'])
89
- st.button('Not Satisfied! Talk to our Expert Here..')
 
 
 
71
 
72
  def run_google_search(self, query):
73
  search = GoogleSerperAPIWrapper()
74
+ return search.run(query)
75
 
76
  if __name__ == "__main__":
77
  chatbot = Chatbot()
78
  data = chatbot.load_data()
79
  docs = chatbot.split_documents(data)
80
  retriever = chatbot.create_embeddings(docs)
81
+ retrievers = chatbot.load_embeddings()
82
+ qa = chatbot.create_qa_model(retrievers)
83
 
84
  st.title('Chatbot Trained on Indian Exam Articles')
85
  st.header("Hi!! How Can I Help You ?")
86
 
87
+ query = st.text_input('ENTER TEXT HERE ')
88
  result = qa({'query': query})
89
  st.write(result['result'])
90
+ if st.button('Not Satisfied! Talk to our Expert Here..'):
91
+ st.write(run_google_search(query))
92
+