Spaces:
Runtime error
Runtime error
Commit
路
90917fe
1
Parent(s):
5b9fe0b
Update app.py
Browse files
app.py
CHANGED
@@ -206,37 +206,37 @@ def analizar_frase(frase):
|
|
206 |
tabla = st.text("Solo Frase en espa帽ol")
|
207 |
|
208 |
return tabla
|
209 |
-
|
210 |
def run():
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
|
242 |
run()
|
|
|
206 |
tabla = st.text("Solo Frase en espa帽ol")
|
207 |
|
208 |
return tabla
|
209 |
+
|
210 |
def run():
|
211 |
+
colT1, colT2 = st.columns([4, 4])
|
212 |
+
with colT2:
|
213 |
+
with st.form("my_form"):
|
214 |
+
col1, col2, col3 = st.columns([2, 2, 1])
|
215 |
+
st.write("Escoja una Opci贸n")
|
216 |
+
search_words = col1.text_input("Introduzca la frase, el usuario o localidad para analizar y pulse el check correspondiente")
|
217 |
+
number_of_tweets = col2.number_input('Introduzca n煤mero de tweets a analizar del usuario M谩ximo 50', 0,50,0)
|
218 |
+
termino = st.checkbox('Frase', key="frase_checkbox")
|
219 |
+
usuario = st.checkbox('Usuario', key="usuario_checkbox")
|
220 |
+
localidad = st.checkbox('Localidad', key="localidad_checkbox")
|
221 |
+
submit_button = col3.form_submit_button(label='Analizar')
|
222 |
+
error = False
|
223 |
|
224 |
+
if submit_button:
|
225 |
+
# Condici贸n para el caso de que esten dos check seleccionados
|
226 |
+
if ( termino == False and usuario == False and localidad == False):
|
227 |
+
st.text('Error no se ha seleccionado ningun check')
|
228 |
+
error=True
|
229 |
+
elif ( termino == True and usuario == True and localidad == True):
|
230 |
+
st.text('Error se han seleccionado varios check')
|
231 |
+
error=True
|
232 |
+
|
233 |
+
with colT1:
|
234 |
+
if (error == False):
|
235 |
+
if (termino):
|
236 |
+
analizar_frase(search_words)
|
237 |
+
elif (usuario):
|
238 |
+
tweets_usuario(search_words,number_of_tweets)
|
239 |
+
elif (localidad):
|
240 |
+
tweets_localidad(search_words)
|
241 |
|
242 |
run()
|