Lavlu118557 commited on
Commit
5e80ca8
·
verified ·
1 Parent(s): 7279efe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -35,6 +35,14 @@ def fuzzy_match(query, qa_data, threshold=0.6):
35
  return item
36
  return None
37
 
 
 
 
 
 
 
 
 
38
  # ✅ চ্যাট রেসপন্স ফাংশন
39
  def respond(message, history):
40
  emotion = detect_emotion(message)
 
35
  return item
36
  return None
37
 
38
+ def load_qa_yaml(path="bonolota_ai_dataset/qa.yaml"):
39
+ try:
40
+ with open(path, "r", encoding="utf-8") as f:
41
+ return yaml.safe_load(f)
42
+ except FileNotFoundError:
43
+ print("⚠️ QA YAML ফাইল পাওয়া যায়নি।")
44
+ return []
45
+
46
  # ✅ চ্যাট রেসপন্স ফাংশন
47
  def respond(message, history):
48
  emotion = detect_emotion(message)