Spaces:
Runtime error
Runtime error
Commit
·
9091676
1
Parent(s):
4f31ce9
Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
92 |
for tweet in tweets:
|
93 |
if (tweet.full_text.startswith('RT')):
|
94 |
continue
|
95 |
-
elif tweet.full_text
|
96 |
continue
|
97 |
else:
|
98 |
datos = preprocess(tweet.full_text)
|
@@ -104,10 +104,10 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
104 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
105 |
df = df[df["Prediccion"] == 'Sexista']
|
106 |
df = df[df["Probabilidad"] > 0.5]
|
107 |
-
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
108 |
if df.empty:
|
109 |
st.text("No hay tweets a analizar")
|
110 |
else:
|
|
|
111 |
tabla.append(muestra)
|
112 |
#resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
113 |
#colores=["#aae977","#EE3555"]
|
|
|
92 |
for tweet in tweets:
|
93 |
if (tweet.full_text.startswith('RT')):
|
94 |
continue
|
95 |
+
elif not tweet.full_text.strip():
|
96 |
continue
|
97 |
else:
|
98 |
datos = preprocess(tweet.full_text)
|
|
|
104 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
105 |
df = df[df["Prediccion"] == 'Sexista']
|
106 |
df = df[df["Probabilidad"] > 0.5]
|
|
|
107 |
if df.empty:
|
108 |
st.text("No hay tweets a analizar")
|
109 |
else:
|
110 |
+
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
111 |
tabla.append(muestra)
|
112 |
#resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
113 |
#colores=["#aae977","#EE3555"]
|