Update modules/ui/ui.py
Browse files- modules/ui/ui.py +20 -16
modules/ui/ui.py
CHANGED
@@ -232,6 +232,7 @@ def register_form():
|
|
232 |
logger.error(f"Failed to store application request for {email}")
|
233 |
|
234 |
|
|
|
235 |
def is_institutional_email(email):
|
236 |
forbidden_domains = ['gmail.com', 'hotmail.com', 'yahoo.com', 'outlook.com']
|
237 |
return not any(domain in email.lower() for domain in forbidden_domains)
|
@@ -481,12 +482,6 @@ def display_morphosyntax_analysis_interface(nlp_models, lang_code):
|
|
481 |
# An谩lisis morfosint谩ctico avanzado
|
482 |
advanced_analysis = perform_advanced_morphosyntactic_analysis(current_input, nlp_models[lang_code])
|
483 |
|
484 |
-
# Mostrar an谩lisis de palabras repetidas (c贸digo existente)
|
485 |
-
word_colors = get_repeated_words_colors(doc)
|
486 |
-
with st.expander(t['repeated_words'], expanded=True):
|
487 |
-
highlighted_text = highlight_repeated_words(doc, word_colors)
|
488 |
-
st.markdown(highlighted_text, unsafe_allow_html=True)
|
489 |
-
|
490 |
# Mostrar leyenda (c贸digo existente)
|
491 |
st.markdown(f"##### {t['legend']}")
|
492 |
legend_html = "<div style='display: flex; flex-wrap: wrap;'>"
|
@@ -496,16 +491,12 @@ def display_morphosyntax_analysis_interface(nlp_models, lang_code):
|
|
496 |
legend_html += "</div>"
|
497 |
st.markdown(legend_html, unsafe_allow_html=True)
|
498 |
|
499 |
-
# Mostrar an谩lisis de
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
with st.expander(t['morphological_analysis'], expanded=True):
|
506 |
-
morph_df = pd.DataFrame(advanced_analysis['morphological_analysis'])
|
507 |
-
st.dataframe(morph_df)
|
508 |
-
|
509 |
# Mostrar estructura de oraciones
|
510 |
with st.expander(t['sentence_structure'], expanded=True):
|
511 |
for i, sent_analysis in enumerate(advanced_analysis['sentence_structure']):
|
@@ -514,6 +505,19 @@ def display_morphosyntax_analysis_interface(nlp_models, lang_code):
|
|
514 |
st.write(f"{t['subjects']}: {', '.join(sent_analysis['subjects'])}")
|
515 |
st.write(f"{t['objects']}: {', '.join(sent_analysis['objects'])}")
|
516 |
st.write(f"{t['verbs']}: {', '.join(sent_analysis['verbs'])}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
|
518 |
# Mostrar diagramas de arco (c贸digo existente)
|
519 |
with st.expander(t['arc_diagram'], expanded=True):
|
|
|
232 |
logger.error(f"Failed to store application request for {email}")
|
233 |
|
234 |
|
235 |
+
################################################################################
|
236 |
def is_institutional_email(email):
|
237 |
forbidden_domains = ['gmail.com', 'hotmail.com', 'yahoo.com', 'outlook.com']
|
238 |
return not any(domain in email.lower() for domain in forbidden_domains)
|
|
|
482 |
# An谩lisis morfosint谩ctico avanzado
|
483 |
advanced_analysis = perform_advanced_morphosyntactic_analysis(current_input, nlp_models[lang_code])
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
# Mostrar leyenda (c贸digo existente)
|
486 |
st.markdown(f"##### {t['legend']}")
|
487 |
legend_html = "<div style='display: flex; flex-wrap: wrap;'>"
|
|
|
491 |
legend_html += "</div>"
|
492 |
st.markdown(legend_html, unsafe_allow_html=True)
|
493 |
|
494 |
+
# Mostrar an谩lisis de palabras repetidas (c贸digo existente)
|
495 |
+
word_colors = get_repeated_words_colors(doc)
|
496 |
+
with st.expander(t['repeated_words'], expanded=True):
|
497 |
+
highlighted_text = highlight_repeated_words(doc, word_colors)
|
498 |
+
st.markdown(highlighted_text, unsafe_allow_html=True)
|
499 |
+
|
|
|
|
|
|
|
|
|
500 |
# Mostrar estructura de oraciones
|
501 |
with st.expander(t['sentence_structure'], expanded=True):
|
502 |
for i, sent_analysis in enumerate(advanced_analysis['sentence_structure']):
|
|
|
505 |
st.write(f"{t['subjects']}: {', '.join(sent_analysis['subjects'])}")
|
506 |
st.write(f"{t['objects']}: {', '.join(sent_analysis['objects'])}")
|
507 |
st.write(f"{t['verbs']}: {', '.join(sent_analysis['verbs'])}")
|
508 |
+
)
|
509 |
+
st.markdown(sentence_str)
|
510 |
+
|
511 |
+
# Mostrar an谩lisis de categor铆as gramaticales # Mostrar an谩lisis morfol贸gico
|
512 |
+
col1, col2 =st.columns(2)
|
513 |
+
with col1:
|
514 |
+
with st.expander(t['pos_analysis'], expanded=True):
|
515 |
+
pos_df = pd.DataFrame(advanced_analysis['pos_analysis'])
|
516 |
+
st.dataframe(pos_df)
|
517 |
+
with col2:
|
518 |
+
with st.expander(t['morphological_analysis'], expanded=True):
|
519 |
+
morph_df = pd.DataFrame(advanced_analysis['morphological_analysis'])
|
520 |
+
st.dataframe(morph_df)
|
521 |
|
522 |
# Mostrar diagramas de arco (c贸digo existente)
|
523 |
with st.expander(t['arc_diagram'], expanded=True):
|