Spaces:
Runtime error
Runtime error
Commit
·
825a7fe
1
Parent(s):
910eb64
Update app.py
Browse files
app.py
CHANGED
@@ -198,7 +198,7 @@ def analizar_frase(frase):
|
|
198 |
text['Prediccion'] = np.where(text['Prediccion'] == 0 , 'No Sexista', 'Sexista')
|
199 |
|
200 |
|
201 |
-
tabla = st.table(text.reset_index(drop=True).head(
|
202 |
|
203 |
return tabla
|
204 |
|
@@ -255,10 +255,10 @@ def tweets_localidad(buscar_localidad):
|
|
255 |
probability = np.amax(logits1,axis=1).flatten()
|
256 |
Tweets =['Últimos 50 Tweets'+' de '+ buscar_localidad]
|
257 |
df = pd.DataFrame(list(zip(text1, localidad,username, flat_predictions,probability)), columns = ['Tweets' ,'Localidad' , 'Usuario','Prediccion','Probabilidad'])
|
258 |
-
|
259 |
df['Prediccion']= np.where(df['Prediccion']== 0, 'No Sexista', 'Sexista')
|
260 |
#df['Tweets'] = df['Tweets'].str.replace('RT|@', '')
|
261 |
-
|
262 |
#df['Tweets'] = df['Tweets'].apply(lambda x: re.sub(r'[:;][-o^]?[)\]DpP3]|[(/\\]|[\U0001f600-\U0001f64f]|[\U0001f300-\U0001f5ff]|[\U0001f680-\U0001f6ff]|[\U0001f1e0-\U0001f1ff]','', x))
|
263 |
|
264 |
tabla = st.table(df.reset_index(drop=True).head(50).style.applymap(color_survived, subset=['Prediccion']))
|
|
|
198 |
text['Prediccion'] = np.where(text['Prediccion'] == 0 , 'No Sexista', 'Sexista')
|
199 |
|
200 |
|
201 |
+
tabla = st.table(text.reset_index(drop=True).head(50).style.applymap(color_survived, subset=['Prediccion']))
|
202 |
|
203 |
return tabla
|
204 |
|
|
|
255 |
probability = np.amax(logits1,axis=1).flatten()
|
256 |
Tweets =['Últimos 50 Tweets'+' de '+ buscar_localidad]
|
257 |
df = pd.DataFrame(list(zip(text1, localidad,username, flat_predictions,probability)), columns = ['Tweets' ,'Localidad' , 'Usuario','Prediccion','Probabilidad'])
|
258 |
+
|
259 |
df['Prediccion']= np.where(df['Prediccion']== 0, 'No Sexista', 'Sexista')
|
260 |
#df['Tweets'] = df['Tweets'].str.replace('RT|@', '')
|
261 |
+
df_filtrado = df[df["Prediccion"]=="Sexista" ]
|
262 |
#df['Tweets'] = df['Tweets'].apply(lambda x: re.sub(r'[:;][-o^]?[)\]DpP3]|[(/\\]|[\U0001f600-\U0001f64f]|[\U0001f300-\U0001f5ff]|[\U0001f680-\U0001f6ff]|[\U0001f1e0-\U0001f1ff]','', x))
|
263 |
|
264 |
tabla = st.table(df.reset_index(drop=True).head(50).style.applymap(color_survived, subset=['Prediccion']))
|