Update app.py
Browse files
app.py
CHANGED
|
@@ -34,9 +34,9 @@ def qa_system(method, question):
|
|
| 34 |
]
|
| 35 |
for text in question:
|
| 36 |
# Check for financial content
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
prompt = f"You are a financial assistant.\nUse the context below to answer the question.\n\nQuestion: {question}\nAnswer:"
|
| 42 |
|
|
|
|
| 34 |
]
|
| 35 |
for text in question:
|
| 36 |
# Check for financial content
|
| 37 |
+
text_lower = text.lower()
|
| 38 |
+
if any(pattern in text_lower for pattern in financial_keywords):
|
| 39 |
+
return "This question does not seem to be related to Finance"
|
| 40 |
|
| 41 |
prompt = f"You are a financial assistant.\nUse the context below to answer the question.\n\nQuestion: {question}\nAnswer:"
|
| 42 |
|