robertou2 commited on
Commit
3c17604
1 Parent(s): 339a335

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,7 +30,7 @@ api = tw.API(auth, wait_on_rate_limit=True)
30
  st.title('Analisis de comentarios sexistas en Twitter con Tweepy and HuggingFace Transformers')
31
  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')
32
 
33
- def principal(tweets):
34
  tweet_list = [i.text for i in tweets]
35
  text= pd.DataFrame(tweet_list)
36
  text1=text[0].values
@@ -81,11 +81,11 @@ def run():
81
  date_since = "2020-09-14"
82
  new_search = search_words + " -filter:retweets"
83
  tweets = tw.Cursor(api.search_tweets,q=new_search,lang="es",since=date_since).items(number_of_tweets)
84
- principal(tweets)
85
  #tweets =tw.Cursor(api.search_tweets,q=search_words).items(number_of_tweets)
86
  if submit_button1:
87
  tweets = api.user_timeline(screen_name = screen_name,count=500)
88
- principal(tweets)
89
 
90
 
91
  #st.write(df)
 
30
  st.title('Analisis de comentarios sexistas en Twitter con Tweepy and HuggingFace Transformers')
31
  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')
32
 
33
+ def principal(tweets,number_of_tweets):
34
  tweet_list = [i.text for i in tweets]
35
  text= pd.DataFrame(tweet_list)
36
  text1=text[0].values
 
81
  date_since = "2020-09-14"
82
  new_search = search_words + " -filter:retweets"
83
  tweets = tw.Cursor(api.search_tweets,q=new_search,lang="es",since=date_since).items(number_of_tweets)
84
+ principal(tweets,number_of_tweets)
85
  #tweets =tw.Cursor(api.search_tweets,q=search_words).items(number_of_tweets)
86
  if submit_button1:
87
  tweets = api.user_timeline(screen_name = screen_name,count=500)
88
+ principal(tweets,number_of_tweets)
89
 
90
 
91
  #st.write(df)