robertou2 commited on
Commit
6b7217a
1 Parent(s): 06140fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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 nombre'):
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
- submit_button = st.form_submit_button(label='Submit')
 
 
68
  if submit_button:
69
  date_since = "2020-09-14"
70
- if (search_words != ' '):
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 (search_words1 != ' '):
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"