Spaces:
Build error
Build error
feat: Improve sloppy assignment of tweets to array
Browse files
app.py
CHANGED
@@ -197,8 +197,8 @@ with st.spinner(text="Loading brain... π§ "):
|
|
197 |
model = load_model(model_to_use[expected_lang])
|
198 |
|
199 |
if go_btn and tw_user != '':
|
200 |
-
usr = client.get_user(username=tw_user)
|
201 |
tw_user = tw_user.replace(' ', '')
|
|
|
202 |
with st.spinner(f"Getting to know the '{tw_user}'... π"):
|
203 |
tweets_objs = []
|
204 |
while tw_sample >= 100:
|
@@ -208,7 +208,7 @@ if go_btn and tw_user != '':
|
|
208 |
tw_sample -= current_sample
|
209 |
if tw_sample > 0:
|
210 |
tweets_response = client.get_users_tweets(usr.data.id, max_results=tw_sample, exclude=['retweets', 'replies'])
|
211 |
-
|
212 |
tweets_txt = [tweet.text for tweet in tweets_objs]
|
213 |
tweets_txt = list(set(tweets_txt))
|
214 |
tweets_txt_cleaned = preprocess(tweets_txt)
|
|
|
197 |
model = load_model(model_to_use[expected_lang])
|
198 |
|
199 |
if go_btn and tw_user != '':
|
|
|
200 |
tw_user = tw_user.replace(' ', '')
|
201 |
+
usr = client.get_user(username=tw_user)
|
202 |
with st.spinner(f"Getting to know the '{tw_user}'... π"):
|
203 |
tweets_objs = []
|
204 |
while tw_sample >= 100:
|
|
|
208 |
tw_sample -= current_sample
|
209 |
if tw_sample > 0:
|
210 |
tweets_response = client.get_users_tweets(usr.data.id, max_results=tw_sample, exclude=['retweets', 'replies'])
|
211 |
+
tweets_objs += tweets_response.data
|
212 |
tweets_txt = [tweet.text for tweet in tweets_objs]
|
213 |
tweets_txt = list(set(tweets_txt))
|
214 |
tweets_txt_cleaned = preprocess(tweets_txt)
|