Spaces:
Runtime error
Runtime error
Commit
·
6391fa4
1
Parent(s):
a44e7e2
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,7 @@ def run():
|
|
110 |
#new_search = search_words + " -filter:retweets"
|
111 |
#tweets =tw.Cursor(api.search_tweets,q=new_search,lang="es").items(number_of_tweets)
|
112 |
# Tokenizar la frase
|
113 |
-
tokens = tokenizer.tokenize(
|
114 |
# Convertir los tokens a un formato compatible con el modelo
|
115 |
input_ids = tokenizer.convert_tokens_to_ids(tokens)
|
116 |
attention_masks = [1] * len(input_ids)
|
@@ -124,7 +124,7 @@ def run():
|
|
124 |
text= pd.DataFrame({'palabra': [frase],'probabilidad':[probabilidad_sexista]})
|
125 |
#print(text)
|
126 |
st.table(text)
|
127 |
-
text.plot.bar(y='probabilidad')
|
128 |
|
129 |
elif (usuario):
|
130 |
tweets = api.user_timeline(screen_name = search_words,count=number_of_tweets)
|
|
|
110 |
#new_search = search_words + " -filter:retweets"
|
111 |
#tweets =tw.Cursor(api.search_tweets,q=new_search,lang="es").items(number_of_tweets)
|
112 |
# Tokenizar la frase
|
113 |
+
tokens = tokenizer.tokenize(search_words)
|
114 |
# Convertir los tokens a un formato compatible con el modelo
|
115 |
input_ids = tokenizer.convert_tokens_to_ids(tokens)
|
116 |
attention_masks = [1] * len(input_ids)
|
|
|
124 |
text= pd.DataFrame({'palabra': [frase],'probabilidad':[probabilidad_sexista]})
|
125 |
#print(text)
|
126 |
st.table(text)
|
127 |
+
#text.plot.bar(y='probabilidad')
|
128 |
|
129 |
elif (usuario):
|
130 |
tweets = api.user_timeline(screen_name = search_words,count=number_of_tweets)
|