Spaces:
Sleeping
Sleeping
Commit
·
464ff36
1
Parent(s):
db9c28b
3.69
Browse files
app.py
CHANGED
|
@@ -967,8 +967,6 @@ def process_file(uploaded_file, model_choice, translation_method=None):
|
|
| 967 |
df.at[idx, 'Event_Type'] = event_type
|
| 968 |
df.at[idx, 'Event_Summary'] = event_summary
|
| 969 |
|
| 970 |
-
# Update live statistics
|
| 971 |
-
ui.update_stats(row, sentiment, event_type)
|
| 972 |
|
| 973 |
# Show events in real-time
|
| 974 |
if event_type != "Нет":
|
|
@@ -978,6 +976,17 @@ def process_file(uploaded_file, model_choice, translation_method=None):
|
|
| 978 |
row['Заголовок']
|
| 979 |
)
|
| 980 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 981 |
# Handle negative sentiment
|
| 982 |
if sentiment == "Negative":
|
| 983 |
try:
|
|
@@ -1008,7 +1017,8 @@ def process_file(uploaded_file, model_choice, translation_method=None):
|
|
| 1008 |
# Update progress
|
| 1009 |
processed_rows += 1
|
| 1010 |
ui.update_progress(processed_rows, total_rows)
|
| 1011 |
-
|
|
|
|
| 1012 |
except Exception as e:
|
| 1013 |
st.warning(f"Ошибка в обработке ряда {idx + 1}: {str(e)}")
|
| 1014 |
continue
|
|
@@ -1402,7 +1412,7 @@ def main():
|
|
| 1402 |
st.set_page_config(layout="wide")
|
| 1403 |
|
| 1404 |
with st.sidebar:
|
| 1405 |
-
st.title("::: AI-анализ мониторинга новостей (v.3.
|
| 1406 |
st.subheader("по материалам СКАН-ИНТЕРФАКС")
|
| 1407 |
|
| 1408 |
model_choice = st.radio(
|
|
@@ -1428,6 +1438,23 @@ def main():
|
|
| 1428 |
unsafe_allow_html=True
|
| 1429 |
)
|
| 1430 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1431 |
# Main content area
|
| 1432 |
st.title("Анализ мониторинга новостей")
|
| 1433 |
|
|
|
|
| 967 |
df.at[idx, 'Event_Type'] = event_type
|
| 968 |
df.at[idx, 'Event_Summary'] = event_summary
|
| 969 |
|
|
|
|
|
|
|
| 970 |
|
| 971 |
# Show events in real-time
|
| 972 |
if event_type != "Нет":
|
|
|
|
| 976 |
row['Заголовок']
|
| 977 |
)
|
| 978 |
|
| 979 |
+
#Calculate processing speed (items per second)
|
| 980 |
+
time_delta = current_time - last_update_time
|
| 981 |
+
if time_delta > 0:
|
| 982 |
+
processing_speed = 1 / time_delta # items per second
|
| 983 |
+
else:
|
| 984 |
+
processing_speed = 0
|
| 985 |
+
|
| 986 |
+
# Update live statistics
|
| 987 |
+
ui.update_stats(row, sentiment, event_type, processing_speed)
|
| 988 |
+
|
| 989 |
+
|
| 990 |
# Handle negative sentiment
|
| 991 |
if sentiment == "Negative":
|
| 992 |
try:
|
|
|
|
| 1017 |
# Update progress
|
| 1018 |
processed_rows += 1
|
| 1019 |
ui.update_progress(processed_rows, total_rows)
|
| 1020 |
+
last_update_time = current_time
|
| 1021 |
+
|
| 1022 |
except Exception as e:
|
| 1023 |
st.warning(f"Ошибка в обработке ряда {idx + 1}: {str(e)}")
|
| 1024 |
continue
|
|
|
|
| 1412 |
st.set_page_config(layout="wide")
|
| 1413 |
|
| 1414 |
with st.sidebar:
|
| 1415 |
+
st.title("::: AI-анализ мониторинга новостей (v.3.69!):::")
|
| 1416 |
st.subheader("по материалам СКАН-ИНТЕРФАКС")
|
| 1417 |
|
| 1418 |
model_choice = st.radio(
|
|
|
|
| 1438 |
unsafe_allow_html=True
|
| 1439 |
)
|
| 1440 |
|
| 1441 |
+
st.markdown(
|
| 1442 |
+
"""
|
| 1443 |
+
<style>
|
| 1444 |
+
.signature {
|
| 1445 |
+
position: fixed;
|
| 1446 |
+
right: 12px;
|
| 1447 |
+
up: 12px;
|
| 1448 |
+
font-size: 14px;
|
| 1449 |
+
color: #FF0000;
|
| 1450 |
+
opacity: 0.9;
|
| 1451 |
+
z-index: 999;
|
| 1452 |
+
}
|
| 1453 |
+
</style>
|
| 1454 |
+
<div class="signature">denis.pokrovsky.npff</div>
|
| 1455 |
+
""",
|
| 1456 |
+
unsafe_allow_html=True
|
| 1457 |
+
|
| 1458 |
# Main content area
|
| 1459 |
st.title("Анализ мониторинга новостей")
|
| 1460 |
|