Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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)
|