Update app.py
Browse files
app.py
CHANGED
|
@@ -200,6 +200,23 @@ def retrieve_content(question):
|
|
| 200 |
if key in chemistry_content:
|
| 201 |
retrieved[key] = chemistry_content[key]
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
# Fallback for questions not matched by our keywords.
|
| 204 |
if len(retrieved) <= 2:
|
| 205 |
for key in [
|
|
|
|
| 200 |
if key in chemistry_content:
|
| 201 |
retrieved[key] = chemistry_content[key]
|
| 202 |
|
| 203 |
+
|
| 204 |
+
# Retrieve data-recording guidance for hypothetical examples.
|
| 205 |
+
if any(
|
| 206 |
+
keyword in question.lower()
|
| 207 |
+
for keyword in [
|
| 208 |
+
"hypothetical",
|
| 209 |
+
"hypothetical example",
|
| 210 |
+
"example readings",
|
| 211 |
+
"experimental data",
|
| 212 |
+
"actual results",
|
| 213 |
+
"invented results"
|
| 214 |
+
]
|
| 215 |
+
):
|
| 216 |
+
if "data_recording" in chemistry_content:
|
| 217 |
+
retrieved["data_recording"] = chemistry_content["data_recording"]
|
| 218 |
+
|
| 219 |
+
|
| 220 |
# Fallback for questions not matched by our keywords.
|
| 221 |
if len(retrieved) <= 2:
|
| 222 |
for key in [
|