Spaces:
Runtime error
Runtime error
Commit
路
aa1a517
1
Parent(s):
244d0dd
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
86 |
try:
|
87 |
# Buscar la informaci贸n del perfil de usuario
|
88 |
user = api.get_user(screen_name=search_words)
|
89 |
-
st.text(f"La cuenta {search_words} existe.")
|
90 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
91 |
result = []
|
92 |
for tweet in tweets:
|
@@ -103,7 +103,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
103 |
df = pd.DataFrame(result)
|
104 |
if df.empty:
|
105 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
106 |
-
df = df[df["Prediccion"] == 'Sexista']
|
107 |
df = df[df["Probabilidad"] > 0.5]
|
108 |
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
109 |
tabla.append(muestra)
|
@@ -198,7 +198,7 @@ def run():
|
|
198 |
col,buff1, buff2 = st.columns([2,2,1])
|
199 |
st.write("Escoja una Opci贸n")
|
200 |
search_words = col.text_input("Introduzca la frase, el usuario o localidad para analizar y pulse el check correspondiente")
|
201 |
-
number_of_tweets = col.number_input('Introduzca n煤mero de tweets a analizar
|
202 |
termino=st.checkbox('Frase')
|
203 |
usuario=st.checkbox('Usuario')
|
204 |
localidad=st.checkbox('Localidad')
|
|
|
86 |
try:
|
87 |
# Buscar la informaci贸n del perfil de usuario
|
88 |
user = api.get_user(screen_name=search_words)
|
89 |
+
#st.text(f"La cuenta {search_words} existe.")
|
90 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
91 |
result = []
|
92 |
for tweet in tweets:
|
|
|
103 |
df = pd.DataFrame(result)
|
104 |
if df.empty:
|
105 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
106 |
+
#df = df[df["Prediccion"] == 'Sexista']
|
107 |
df = df[df["Probabilidad"] > 0.5]
|
108 |
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
109 |
tabla.append(muestra)
|
|
|
198 |
col,buff1, buff2 = st.columns([2,2,1])
|
199 |
st.write("Escoja una Opci贸n")
|
200 |
search_words = col.text_input("Introduzca la frase, el usuario o localidad para analizar y pulse el check correspondiente")
|
201 |
+
number_of_tweets = col.number_input('Introduzca n煤mero de tweets a analizar del usuario M谩ximo 50', 0,50,0)
|
202 |
termino=st.checkbox('Frase')
|
203 |
usuario=st.checkbox('Usuario')
|
204 |
localidad=st.checkbox('Localidad')
|