Spaces:
Runtime error
Runtime error
wira.indra
commited on
Commit
•
572a5c1
1
Parent(s):
39d5762
add twitter feature
Browse files
app.py
CHANGED
@@ -76,7 +76,10 @@ def twitter_analyzer(keyword, max_tweets):
|
|
76 |
df = ts.scrape_tweets(keyword, max_tweets=max_tweets)
|
77 |
df["Text"] = df["Text"].apply(ts.preprocess_text)
|
78 |
df = sentiment_df(df)
|
|
|
79 |
df_ner = ner_df(df)
|
|
|
|
|
80 |
fig = plt.figure()
|
81 |
df.groupby(["Label"])["Text"].count().plot.pie(autopct="%.1f%%", figsize=(6,6))
|
82 |
return fig, df[["URL", "Text", "Label", "Score"]], df_ner
|
|
|
76 |
df = ts.scrape_tweets(keyword, max_tweets=max_tweets)
|
77 |
df["Text"] = df["Text"].apply(ts.preprocess_text)
|
78 |
df = sentiment_df(df)
|
79 |
+
|
80 |
df_ner = ner_df(df)
|
81 |
+
df_ner = df_ner[df_ner.Entity != keyword]
|
82 |
+
|
83 |
fig = plt.figure()
|
84 |
df.groupby(["Label"])["Text"].count().plot.pie(autopct="%.1f%%", figsize=(6,6))
|
85 |
return fig, df[["URL", "Text", "Label", "Score"]], df_ner
|