BtB-ExpC commited on
Commit
65aa3b0
·
1 Parent(s): af62402

Remove trailing periods from distractors

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -249,8 +249,8 @@ def chatbot(input):
249
  break
250
 
251
  if distractors_index != -1:
252
- # Extract the afleiders into the distractors list
253
- distractors = [line.strip() for line in lines[distractors_index + 1:] if line.strip()]
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 = []