Joshua1808 commited on
Commit
eb03325
·
1 Parent(s): c306ca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -6,6 +6,7 @@ import numpy as np
6
  import regex as re
7
  import pysentimiento
8
  import geopy
 
9
 
10
  from pysentimiento.preprocessing import preprocess_tweet
11
  from geopy.geocoders import Nominatim
@@ -98,7 +99,7 @@ with colT2:
98
 
99
  def analizar_tweets(search_words, number_of_tweets ):
100
  tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
101
- tweet_list = [i.text for i in tweets]
102
  text= pd.DataFrame(tweet_list)
103
  text[0] = text[0].apply(preprocess_tweet)
104
  text_list = text[0].tolist()
@@ -139,8 +140,8 @@ def tweets_localidad(buscar_localidad):
139
  geolocator = Nominatim(user_agent="nombre_del_usuario")
140
  location = geolocator.geocode(buscar_localidad)
141
  radius = "10km"
142
- tweets = api.search_tweets(q="",lang="es",geocode=f"{location.latitude},{location.longitude},{radius}", count = 50)
143
- tweet_list = [i.text for i in tweets]
144
  text= pd.DataFrame(tweet_list)
145
  text[0] = text[0].apply(preprocess_tweet)
146
  text_list = text[0].tolist()
 
6
  import regex as re
7
  import pysentimiento
8
  import geopy
9
+ import matplotlib.pyplot as plt
10
 
11
  from pysentimiento.preprocessing import preprocess_tweet
12
  from geopy.geocoders import Nominatim
 
99
 
100
  def analizar_tweets(search_words, number_of_tweets ):
101
  tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
102
+ tweet_list = [i.full_text for i in tweets]
103
  text= pd.DataFrame(tweet_list)
104
  text[0] = text[0].apply(preprocess_tweet)
105
  text_list = text[0].tolist()
 
140
  geolocator = Nominatim(user_agent="nombre_del_usuario")
141
  location = geolocator.geocode(buscar_localidad)
142
  radius = "10km"
143
+ tweets = api.search_tweets(q="",lang="es",geocode=f"{location.latitude},{location.longitude},{radius}", count = 50, tweet_mode="extended")
144
+ tweet_list = [i.full_text for i in tweets]
145
  text= pd.DataFrame(tweet_list)
146
  text[0] = text[0].apply(preprocess_tweet)
147
  text_list = text[0].tolist()