Joshua1808 commited on
Commit
868386d
·
1 Parent(s): 9091676

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -92,14 +92,15 @@ def analizar_tweets(search_words, number_of_tweets):
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)
99
- prediction = pipeline_nlp(datos)
100
- for predic in prediction:
101
- etiqueta = {'Tweets': datos,'Prediccion': predic['label'], 'Probabilidad': predic['score']}
102
- result.append(etiqueta)
 
 
 
103
  df = pd.DataFrame(result)
104
  df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
105
  df = df[df["Prediccion"] == 'Sexista']
 
92
  for tweet in tweets:
93
  if (tweet.full_text.startswith('RT')):
94
  continue
 
 
95
  else:
96
  datos = preprocess(tweet.full_text)
97
+ if datos == "":
98
+ continue
99
+ else:
100
+ prediction = pipeline_nlp(datos)
101
+ for predic in prediction:
102
+ etiqueta = {'Tweets': datos,'Prediccion': predic['label'], 'Probabilidad': predic['score']}
103
+ result.append(etiqueta)
104
  df = pd.DataFrame(result)
105
  df['Prediccion'] = np.where( df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
106
  df = df[df["Prediccion"] == 'Sexista']