Spaces:
Sleeping
Sleeping
Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
|
@@ -87,11 +87,11 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 87 |
with input_col:
|
| 88 |
# Text area con manejo de estado
|
| 89 |
text_input = st.text_area(
|
| 90 |
-
current_situation_t['input_prompt'], # Corregido: usar corchetes
|
| 91 |
height=400,
|
| 92 |
key="text_area",
|
| 93 |
value=st.session_state.text_input,
|
| 94 |
-
help=current_situation_t.get('help', '') # Manejar clave faltante
|
| 95 |
)
|
| 96 |
|
| 97 |
# Funci贸n para manejar cambios de texto
|
|
@@ -100,13 +100,13 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 100 |
st.session_state.show_results = False
|
| 101 |
|
| 102 |
if st.button(
|
| 103 |
-
current_situation_t['analyze_button'], # Corregido: usar corchetes
|
| 104 |
type="primary",
|
| 105 |
disabled=not text_input.strip(),
|
| 106 |
use_container_width=True,
|
| 107 |
):
|
| 108 |
try:
|
| 109 |
-
with st.spinner(current_situation_t['processing']): # Corregido: usar corchetes
|
| 110 |
doc = nlp_models[lang_code](text_input)
|
| 111 |
metrics = analyze_text_dimensions(doc)
|
| 112 |
|
|
@@ -139,7 +139,7 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 139 |
format_func=lambda x: TEXT_TYPES[x]['name'],
|
| 140 |
horizontal=True,
|
| 141 |
key="text_type_radio",
|
| 142 |
-
help=current_situation_t.get('text_type_help', '') # Manejar clave faltante
|
| 143 |
)
|
| 144 |
|
| 145 |
st.session_state.current_text_type = text_type
|
|
@@ -155,8 +155,6 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 155 |
logger.error(f"Error en interfaz principal: {str(e)}")
|
| 156 |
st.error(current_situation_t.get('error_interface', 'Interface error')) # Manejar clave faltante
|
| 157 |
|
| 158 |
-
# ... (El resto del archivo mantiene las mismas correcciones con corchetes y get())
|
| 159 |
-
|
| 160 |
######################################
|
| 161 |
def display_radar_chart(metrics_config, thresholds, current_situation_t):
|
| 162 |
"""
|
|
|
|
| 87 |
with input_col:
|
| 88 |
# Text area con manejo de estado
|
| 89 |
text_input = st.text_area(
|
| 90 |
+
current_situation_t.get['input_prompt'], # Corregido: usar corchetes
|
| 91 |
height=400,
|
| 92 |
key="text_area",
|
| 93 |
value=st.session_state.text_input,
|
| 94 |
+
help=current_situation_t.get('help', 'We will analyze your text to know its current status') # Manejar clave faltante
|
| 95 |
)
|
| 96 |
|
| 97 |
# Funci贸n para manejar cambios de texto
|
|
|
|
| 100 |
st.session_state.show_results = False
|
| 101 |
|
| 102 |
if st.button(
|
| 103 |
+
current_situation_t.get['analyze_button'], # Corregido: usar corchetes
|
| 104 |
type="primary",
|
| 105 |
disabled=not text_input.strip(),
|
| 106 |
use_container_width=True,
|
| 107 |
):
|
| 108 |
try:
|
| 109 |
+
with st.spinner(current_situation_t.get['processing']): # Corregido: usar corchetes
|
| 110 |
doc = nlp_models[lang_code](text_input)
|
| 111 |
metrics = analyze_text_dimensions(doc)
|
| 112 |
|
|
|
|
| 139 |
format_func=lambda x: TEXT_TYPES[x]['name'],
|
| 140 |
horizontal=True,
|
| 141 |
key="text_type_radio",
|
| 142 |
+
help=current_situation_t.get('text_type_help', 'Select the type of text to adjust the evaluation criteria') # Manejar clave faltante
|
| 143 |
)
|
| 144 |
|
| 145 |
st.session_state.current_text_type = text_type
|
|
|
|
| 155 |
logger.error(f"Error en interfaz principal: {str(e)}")
|
| 156 |
st.error(current_situation_t.get('error_interface', 'Interface error')) # Manejar clave faltante
|
| 157 |
|
|
|
|
|
|
|
| 158 |
######################################
|
| 159 |
def display_radar_chart(metrics_config, thresholds, current_situation_t):
|
| 160 |
"""
|