MSey commited on
Commit
ba7e177
·
verified ·
1 Parent(s): 50979de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -19,6 +19,9 @@ if user_input:
19
  with st.spinner('Generating response...'):
20
  response = pipe(contexted_ipnut)
21
  st.write("Response:")
 
 
 
22
  # Initialize the highlighted text
23
  highlighted_text = ""
24
  last_position = 0
 
19
  with st.spinner('Generating response...'):
20
  response = pipe(contexted_ipnut)
21
  st.write("Response:")
22
+ # Sorting response by the 'start' position to handle overlapping entities correctly
23
+ response = sorted(response, key=lambda x: x['start'])
24
+
25
  # Initialize the highlighted text
26
  highlighted_text = ""
27
  last_position = 0