Update app.py
Browse files
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
|