fixed global df
Browse files
app.py
CHANGED
@@ -70,6 +70,7 @@ def scrape(keyword_list):
|
|
70 |
|
71 |
def get_example(dataset):
|
72 |
df = pd.read_csv(dataset + '.csv')
|
|
|
73 |
|
74 |
def give_emoji_free_text(text):
|
75 |
"""
|
@@ -129,7 +130,7 @@ def tokenize(text):
|
|
129 |
|
130 |
return tokens
|
131 |
|
132 |
-
def cleaning():
|
133 |
df.rename(columns = {'tweet':'original_tweets'}, inplace = True)
|
134 |
|
135 |
# Apply the function above and get tweets free of emoji's
|
@@ -504,11 +505,11 @@ def optimized_bertopic():
|
|
504 |
def main(dataset, model):
|
505 |
keyword_list = dataset.split(',')
|
506 |
if dataset in examples:
|
507 |
-
get_example(keyword_list)
|
508 |
place_data = 'test'
|
509 |
else:
|
510 |
place_data = str(scrape(keyword_list))
|
511 |
-
cleaning()
|
512 |
|
513 |
print(df)
|
514 |
if model == 'LDA':
|
|
|
70 |
|
71 |
def get_example(dataset):
|
72 |
df = pd.read_csv(dataset + '.csv')
|
73 |
+
return df
|
74 |
|
75 |
def give_emoji_free_text(text):
|
76 |
"""
|
|
|
130 |
|
131 |
return tokens
|
132 |
|
133 |
+
def cleaning(df):
|
134 |
df.rename(columns = {'tweet':'original_tweets'}, inplace = True)
|
135 |
|
136 |
# Apply the function above and get tweets free of emoji's
|
|
|
505 |
def main(dataset, model):
|
506 |
keyword_list = dataset.split(',')
|
507 |
if dataset in examples:
|
508 |
+
df = get_example(keyword_list)
|
509 |
place_data = 'test'
|
510 |
else:
|
511 |
place_data = str(scrape(keyword_list))
|
512 |
+
cleaning(df)
|
513 |
|
514 |
print(df)
|
515 |
if model == 'LDA':
|