edjdhug3 commited on
Commit
499f124
·
1 Parent(s): 0eb4d48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -65,26 +65,20 @@ class Chatbot:
65
  st.header("Hi!! How Can I Help You ?")
66
 
67
  query = st.text_input('> ')
 
 
68
  result = self.qa({'query': query})
69
  st.write(result['result'])
70
- st.button('Not Satisfied! Talk to our Expert Here..')
71
 
72
  def run_google_search(self, query):
73
  search = GoogleSerperAPIWrapper()
74
- search.run
 
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..')
90
-
 
65
  st.header("Hi!! How Can I Help You ?")
66
 
67
  query = st.text_input('> ')
68
+ if st.button('Search'):
69
+ self.run_google_search(query)
70
  result = self.qa({'query': query})
71
  st.write(result['result'])
 
72
 
73
  def run_google_search(self, query):
74
  search = GoogleSerperAPIWrapper()
75
+ search.run(query)
76
+
77
 
78
  if __name__ == "__main__":
79
  chatbot = Chatbot()
80
  data = chatbot.load_data()
81
  docs = chatbot.split_documents(data)
82
  retriever = chatbot.create_embeddings(docs)
83
+ chatbot.qa = chatbot.create_qa_model(retriever)
84
+ chatbot.run_chatbot()