fix examples
Browse files
app.py
CHANGED
|
@@ -502,13 +502,22 @@ def optimized_bertopic():
|
|
| 502 |
print(tweets)
|
| 503 |
top_tweets.append(tweets)
|
| 504 |
|
|
|
|
|
|
|
| 505 |
def main(dataset, model):
|
| 506 |
global df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
keyword_list = dataset.split(',')
|
| 508 |
if dataset in examples:
|
| 509 |
df = get_example(keyword_list)
|
| 510 |
place_data = 'test'
|
| 511 |
else:
|
|
|
|
| 512 |
place_data = str(scrape(keyword_list))
|
| 513 |
print(df)
|
| 514 |
cleaning(df)
|
|
@@ -529,14 +538,7 @@ def main(dataset, model):
|
|
| 529 |
|
| 530 |
return place_data, headlines
|
| 531 |
|
| 532 |
-
|
| 533 |
-
examples = [
|
| 534 |
-
["katip,katipunan"],
|
| 535 |
-
["bgc,bonifacio global city"],
|
| 536 |
-
["pobla,poblacion"],
|
| 537 |
-
["cubao"],
|
| 538 |
-
["taft"]
|
| 539 |
-
]
|
| 540 |
iface = gr.Interface(fn=main,
|
| 541 |
inputs=[gr.Dropdown(["katip,katipunan",
|
| 542 |
"bgc,bonifacio global city",
|
|
|
|
| 502 |
print(tweets)
|
| 503 |
top_tweets.append(tweets)
|
| 504 |
|
| 505 |
+
global examples
|
| 506 |
+
|
| 507 |
def main(dataset, model):
|
| 508 |
global df
|
| 509 |
+
examples = [ "katip,katipunan",
|
| 510 |
+
"bgc,bonifacio global city",
|
| 511 |
+
"pobla,poblacion",
|
| 512 |
+
"cubao",
|
| 513 |
+
"taft"
|
| 514 |
+
]
|
| 515 |
keyword_list = dataset.split(',')
|
| 516 |
if dataset in examples:
|
| 517 |
df = get_example(keyword_list)
|
| 518 |
place_data = 'test'
|
| 519 |
else:
|
| 520 |
+
print(dataset)
|
| 521 |
place_data = str(scrape(keyword_list))
|
| 522 |
print(df)
|
| 523 |
cleaning(df)
|
|
|
|
| 538 |
|
| 539 |
return place_data, headlines
|
| 540 |
|
| 541 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
iface = gr.Interface(fn=main,
|
| 543 |
inputs=[gr.Dropdown(["katip,katipunan",
|
| 544 |
"bgc,bonifacio global city",
|