Spaces:
Sleeping
Sleeping
Remove trailing periods from distractors
Browse files
app.py
CHANGED
|
@@ -249,8 +249,8 @@ def chatbot(input):
|
|
| 249 |
break
|
| 250 |
|
| 251 |
if distractors_index != -1:
|
| 252 |
-
|
| 253 |
-
distractors = [line.
|
| 254 |
else:
|
| 255 |
# Handle the case where "Afleiders:" is not found
|
| 256 |
distractors = []
|
|
|
|
| 249 |
break
|
| 250 |
|
| 251 |
if distractors_index != -1:
|
| 252 |
+
# Extract the afleiders into the distractors list and remove any trailing periods
|
| 253 |
+
distractors = [line.rstrip('.').strip for line in lines[distractors_index + 1:] if line.strip()]
|
| 254 |
else:
|
| 255 |
# Handle the case where "Afleiders:" is not found
|
| 256 |
distractors = []
|