dschandra commited on
Commit
370e85e
·
verified ·
1 Parent(s): 31d430e

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +11 -3
chatbot.py CHANGED
@@ -1,9 +1,17 @@
1
- from knowledge_base import get_answer_from_knowledge_base
2
 
3
  def generate_answer(question):
4
- # Here we are getting the answer from a knowledge base.
 
 
 
 
 
 
 
 
 
5
  answer = get_answer_from_knowledge_base(question)
6
-
7
  if answer:
8
  return answer
9
  else:
 
1
+ from knowledge_base import get_answer_from_knowledge_base, load_qa_model
2
 
3
  def generate_answer(question):
4
+ # Check if the question is in the custom answers dictionary
5
+ custom_answers = {
6
+ "Who is the chief minister of AP?": "Y. S. Jagan Mohan Reddy",
7
+ # Add other custom answers if necessary
8
+ }
9
+
10
+ if question in custom_answers:
11
+ return custom_answers[question]
12
+
13
+ # If not, get the answer from the knowledge base using Hugging Face model
14
  answer = get_answer_from_knowledge_base(question)
 
15
  if answer:
16
  return answer
17
  else: