Zoe911 commited on
Commit
3b8de2e
·
verified ·
1 Parent(s): 0259b0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -85,9 +85,11 @@ def process_text(text):
85
  start_time = normalize_data_time(start_str)
86
  end_time = normalize_data_time(end_str)
87
  else:
88
- # If no range, use the first TIME entity as start time
89
- if entities["TIME"]:
90
  start_time = normalize_data_time(entities["TIME"][0])
 
 
91
 
92
  # Calculate duration if both start and end times are available
93
  if start_time and end_time:
 
85
  start_time = normalize_data_time(start_str)
86
  end_time = normalize_data_time(end_str)
87
  else:
88
+ # If no range, use the first and second TIME entities
89
+ if len(entities["TIME"]) >= 1:
90
  start_time = normalize_data_time(entities["TIME"][0])
91
+ if len(entities["TIME"]) >= 2:
92
+ end_time = normalize_data_time(entities["TIME"][1])
93
 
94
  # Calculate duration if both start and end times are available
95
  if start_time and end_time: