Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,11 @@ with st.form(key='my_form'):
|
|
| 30 |
text_input = st.text_input(label='Enter a sentence')
|
| 31 |
submit_button = st.form_submit_button(label='Submit')
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
# Process the text and extract the entities
|
| 34 |
if text_input:
|
| 35 |
entities = refined_model.process_text(text_input)
|
|
@@ -66,7 +71,7 @@ if text_input:
|
|
| 66 |
final_text.append((word, get_entity_description(word, combined_entity_info_dictionary), "#8ef"))
|
| 67 |
# If the word is not an entity, keep it as it is
|
| 68 |
else:
|
| 69 |
-
final_text.append(word)
|
| 70 |
|
| 71 |
# Pass the final_text to the annotated_text function
|
| 72 |
annotated_text(*final_text)
|
|
|
|
| 30 |
text_input = st.text_input(label='Enter a sentence')
|
| 31 |
submit_button = st.form_submit_button(label='Submit')
|
| 32 |
|
| 33 |
+
# Create the form
|
| 34 |
+
with st.form(key='my_form'):
|
| 35 |
+
text_input = st.text_input(label='Enter a sentence')
|
| 36 |
+
submit_button = st.form_submit_button(label='Submit')
|
| 37 |
+
|
| 38 |
# Process the text and extract the entities
|
| 39 |
if text_input:
|
| 40 |
entities = refined_model.process_text(text_input)
|
|
|
|
| 71 |
final_text.append((word, get_entity_description(word, combined_entity_info_dictionary), "#8ef"))
|
| 72 |
# If the word is not an entity, keep it as it is
|
| 73 |
else:
|
| 74 |
+
final_text.append(word + " ")
|
| 75 |
|
| 76 |
# Pass the final_text to the annotated_text function
|
| 77 |
annotated_text(*final_text)
|