Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,18 +59,18 @@ st.title('Analisis de comentarios sexistas en Twitter con Tweepy and HuggingFace
|
|
59 |
st.markdown('Esta app utiliza tweepy para descargar tweets de twitter en base a la informaci贸n de entrada y procesa los tweets usando transformers de HuggingFace para detectar comentarios sexistas. El resultado y los tweets correspondientes se almacenan en un dataframe para mostrarlo que es lo que se ve como resultado')
|
60 |
|
61 |
def run():
|
62 |
-
with st.form(key='Introduzca
|
63 |
-
search_words = st.text_input('Introduzca el termino para analizar')
|
64 |
-
search_words1 = st.text_input('Introduzca el usuario para analizar')
|
65 |
-
|
66 |
number_of_tweets = st.number_input('Introduzca n煤mero de twweets a analizar. M谩ximo 50', 0,50,10)
|
67 |
-
|
|
|
|
|
68 |
if submit_button:
|
69 |
date_since = "2020-09-14"
|
70 |
-
if (
|
71 |
new_search = search_words + " -filter:retweets"
|
72 |
tweets =tw.Cursor(api.search_tweets,q=new_search,lang="es",since=date_since).items(number_of_tweets)
|
73 |
-
elif (
|
74 |
tweets = api.user_timeline(screen_name = search_words1,count=50)
|
75 |
|
76 |
#new_search = search_words + " -filter:retweets"
|
|
|
59 |
st.markdown('Esta app utiliza tweepy para descargar tweets de twitter en base a la informaci贸n de entrada y procesa los tweets usando transformers de HuggingFace para detectar comentarios sexistas. El resultado y los tweets correspondientes se almacenan en un dataframe para mostrarlo que es lo que se ve como resultado')
|
60 |
|
61 |
def run():
|
62 |
+
with st.form(key='Introduzca Texto'):
|
63 |
+
search_words = st.text_input('Introduzca el termino o usuario para analizar y pulse el check ')
|
|
|
|
|
64 |
number_of_tweets = st.number_input('Introduzca n煤mero de twweets a analizar. M谩ximo 50', 0,50,10)
|
65 |
+
termino=st.checkbox('T茅rmino')
|
66 |
+
usuario=st.checkbox('Usuario')
|
67 |
+
submit_button = st.form_submit_button(label='Analizar')
|
68 |
if submit_button:
|
69 |
date_since = "2020-09-14"
|
70 |
+
if (termino):
|
71 |
new_search = search_words + " -filter:retweets"
|
72 |
tweets =tw.Cursor(api.search_tweets,q=new_search,lang="es",since=date_since).items(number_of_tweets)
|
73 |
+
elif (usuario):
|
74 |
tweets = api.user_timeline(screen_name = search_words1,count=50)
|
75 |
|
76 |
#new_search = search_words + " -filter:retweets"
|