Joshua1808 commited on
Commit
fb64dd1
·
1 Parent(s): ea0ca81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
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
- prediction = pipeline_nlp(text)
108
- for predic in prediction:
109
- etiqueta = {'Tweets': text,'Prediccion': predic['label'], 'Probabilidad': predic['score']}
110
- result.append(etiqueta)
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