Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,13 @@ import matplotlib.pyplot as plt
|
|
| 12 |
import pkg_resources
|
| 13 |
import folium
|
| 14 |
import country_converter as coco
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 18 |
font_path = os.path.join(current_dir, "ArabicR2013-J25x.ttf")
|
| 19 |
|
| 20 |
-
ARABIC_STOP_WORDS = {
|
| 21 |
ARABIC_STOP_WORDS = {
|
| 22 |
# First group
|
| 23 |
'في', 'من', 'إلى', 'على', 'علي', 'عن', 'مع', 'خلال', 'حتي', 'حتى', 'إذا',
|
|
@@ -523,7 +524,14 @@ if uploaded_file is not None:
|
|
| 523 |
)
|
| 524 |
|
| 525 |
if st.button("Process Data"):
|
|
|
|
|
|
|
| 526 |
with st.spinner("Processing your data..."):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 527 |
summaries, topic_model = process_and_summarize(
|
| 528 |
df,
|
| 529 |
bert_tokenizer,
|
|
|
|
| 12 |
import pkg_resources
|
| 13 |
import folium
|
| 14 |
import country_converter as coco
|
| 15 |
+
import time
|
| 16 |
+
from tqdm import tqdm
|
| 17 |
|
| 18 |
|
| 19 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 20 |
font_path = os.path.join(current_dir, "ArabicR2013-J25x.ttf")
|
| 21 |
|
|
|
|
| 22 |
ARABIC_STOP_WORDS = {
|
| 23 |
# First group
|
| 24 |
'في', 'من', 'إلى', 'على', 'علي', 'عن', 'مع', 'خلال', 'حتي', 'حتى', 'إذا',
|
|
|
|
| 524 |
)
|
| 525 |
|
| 526 |
if st.button("Process Data"):
|
| 527 |
+
start_time = time.time()
|
| 528 |
+
time_placeholder = st.empty()
|
| 529 |
with st.spinner("Processing your data..."):
|
| 530 |
+
while True:
|
| 531 |
+
current_time = time.time()
|
| 532 |
+
elapsed_time = current_time - start_time
|
| 533 |
+
time_placeholder.metric(label="Elapsed Time", value=f"{int(elapsed_time)} seconds")
|
| 534 |
+
|
| 535 |
summaries, topic_model = process_and_summarize(
|
| 536 |
df,
|
| 537 |
bert_tokenizer,
|