Spaces:
Runtime error
Runtime error
Commit
·
3943bfc
1
Parent(s):
69864c1
Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,7 @@ def tweets_usuario(usuario, cant_de_tweets):
|
|
116 |
df.sort_values(by=['Prediccion', 'Probabilidad'], ascending=[False, False], inplace=True)
|
117 |
df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
118 |
df['Probabilidad'] = df['Probabilidad'].apply(lambda x: round(x, 3))
|
119 |
-
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
120 |
tabla.append(muestra)
|
121 |
except Exception as e:
|
122 |
muestra = st.text(f"La cuenta {search_words} no existe.")
|
@@ -156,10 +156,11 @@ def tweets_localidad(buscar_localidad):
|
|
156 |
#df.sort_values(by='Prediccion', ascending=False, inplace=True)
|
157 |
df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
158 |
df['Probabilidad'] = df['Probabilidad'].round(3)
|
159 |
-
|
160 |
tab1, tab2 = st.tabs(["📈 Chart", "🗃 Data"])
|
161 |
tab1.subheader("Datos")
|
162 |
#tabla.append(muestra)
|
|
|
163 |
tab2.write(muestra)
|
164 |
tab2.subheader("Gráfico")
|
165 |
resultado = df['Prediccion'].value_counts()
|
|
|
116 |
df.sort_values(by=['Prediccion', 'Probabilidad'], ascending=[False, False], inplace=True)
|
117 |
df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
118 |
df['Probabilidad'] = df['Probabilidad'].apply(lambda x: round(x, 3))
|
119 |
+
muestra = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']), max_rows=9)
|
120 |
tabla.append(muestra)
|
121 |
except Exception as e:
|
122 |
muestra = st.text(f"La cuenta {search_words} no existe.")
|
|
|
156 |
#df.sort_values(by='Prediccion', ascending=False, inplace=True)
|
157 |
df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
158 |
df['Probabilidad'] = df['Probabilidad'].round(3)
|
159 |
+
|
160 |
tab1, tab2 = st.tabs(["📈 Chart", "🗃 Data"])
|
161 |
tab1.subheader("Datos")
|
162 |
#tabla.append(muestra)
|
163 |
+
muestra = st.table(df.reset_index(drop=True).head(5).style.applymap(color_survived, subset=['Prediccion']))
|
164 |
tab2.write(muestra)
|
165 |
tab2.subheader("Gráfico")
|
166 |
resultado = df['Prediccion'].value_counts()
|