Maria Tsilimos
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def load_ner_model():
|
|
| 45 |
try:
|
| 46 |
return pipeline("token-classification",
|
| 47 |
model="saattrupdan/nbailab-base-ner-scandi",
|
| 48 |
-
aggregation_strategy="max",
|
| 49 |
stride=128)
|
| 50 |
except Exception as e:
|
| 51 |
st.error(f"Failed to load NER model. Please check your internet connection or model availability: {e}")
|
|
@@ -133,9 +133,9 @@ with st.sidebar:
|
|
| 133 |
container.write("**Named Entity Recognition (NER)** is the task of "
|
| 134 |
"extracting and tagging entities in text data. Entities can be persons, "
|
| 135 |
"organizations, locations, countries, products, events etc.")
|
| 136 |
-
st.subheader("Related
|
| 137 |
st.link_button("MediDoc Entity Finder",
|
| 138 |
-
"https://nlpblogs.com/shop/named-entity-recognition-ner/medidoc-entity-finder/",
|
| 139 |
type="primary")
|
| 140 |
|
| 141 |
|
|
@@ -406,4 +406,3 @@ if st.button("Results"):
|
|
| 406 |
elapsed_time = end_time - start_time
|
| 407 |
st.info(f"Results processed in **{elapsed_time:.2f} seconds**.")
|
| 408 |
st.write(f"Number of times you requested results: **{st.session_state['file_upload_attempts']}/{max_attempts}**")
|
| 409 |
-
|
|
|
|
| 45 |
try:
|
| 46 |
return pipeline("token-classification",
|
| 47 |
model="saattrupdan/nbailab-base-ner-scandi",
|
| 48 |
+
aggregation_strategy="max", ignore_labels=["O"],
|
| 49 |
stride=128)
|
| 50 |
except Exception as e:
|
| 51 |
st.error(f"Failed to load NER model. Please check your internet connection or model availability: {e}")
|
|
|
|
| 133 |
container.write("**Named Entity Recognition (NER)** is the task of "
|
| 134 |
"extracting and tagging entities in text data. Entities can be persons, "
|
| 135 |
"organizations, locations, countries, products, events etc.")
|
| 136 |
+
st.subheader("Related NER Web Apps", divider="orange")
|
| 137 |
st.link_button("MediDoc Entity Finder",
|
| 138 |
+
" https://nlpblogs.com/shop/named-entity-recognition-ner/medidoc-entity-finder/",
|
| 139 |
type="primary")
|
| 140 |
|
| 141 |
|
|
|
|
| 406 |
elapsed_time = end_time - start_time
|
| 407 |
st.info(f"Results processed in **{elapsed_time:.2f} seconds**.")
|
| 408 |
st.write(f"Number of times you requested results: **{st.session_state['file_upload_attempts']}/{max_attempts}**")
|
|
|