Spaces:
Runtime error
Runtime error
Commit
·
868386d
1
Parent(s):
9091676
Update app.py
Browse files
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 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
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']
|