Spaces:
Runtime error
Runtime error
Commit
·
fb64dd1
1
Parent(s):
ea0ca81
Update app.py
Browse files
app.py
CHANGED
@@ -104,14 +104,12 @@ def analizar_tweets(search_words, number_of_tweets ):
|
|
104 |
text_list = text[0].tolist()
|
105 |
result = []
|
106 |
for text in text_list:
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
df = pd.DataFrame(result)
|
113 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
114 |
-
|
115 |
tabla = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
116 |
|
117 |
return tabla
|
|
|
104 |
text_list = text[0].tolist()
|
105 |
result = []
|
106 |
for text in text_list:
|
107 |
+
prediction = pipeline_nlp(text)
|
108 |
+
for predic in prediction:
|
109 |
+
etiqueta = {'Tweets': text,'Prediccion': predic['label'], 'Probabilidad': predic['score']}
|
110 |
+
result.append(etiqueta)
|
|
|
111 |
df = pd.DataFrame(result)
|
112 |
df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
|
|
|
113 |
tabla = st.table(df.reset_index(drop=True).head(30).style.applymap(color_survived, subset=['Prediccion']))
|
114 |
|
115 |
return tabla
|