From c886a9891cf0a1c2817892a7ca861f7e991a980d Mon Sep 17 00:00:00 2001 From: adistya13 Date: Thu, 21 May 2026 21:53:09 +0700 Subject: [PATCH] perbaikan revisi per halaman dan informatif penyempurnaan per halaman dan tambahan tampilah lebih informatif --- app.py | 35 +- page_modules/crawling_page.py | 656 +++++++----- page_modules/preprocessing_page.py | 269 ++--- page_modules/sentiment_page.py | 1528 +++++++++++++++++++--------- sentiment_service.py | 510 +++++++++- tweets-data/hasil_latest.csv | 3 +- tweets-data/hasil_latest.old.csv | 3 +- tweets-data/hasil_top.csv | 12 - tweets-data/hasil_top.old.csv | 25 +- 9 files changed, 2028 insertions(+), 1013 deletions(-) delete mode 100644 tweets-data/hasil_top.csv diff --git a/app.py b/app.py index 75596fd..2be90a7 100644 --- a/app.py +++ b/app.py @@ -858,19 +858,42 @@ with st.sidebar: """, unsafe_allow_html=True) # ── QUERY ──────────────────────────────────────────────────── +# ── QUERY ──────────────────────────────────────────────────── crawler_query = os.getenv( "QUERY", - 'komdigi (ongkir OR "gratis ongkir" OR "free ongkir")' + 'komdigi (ongkir OR "gratis ongkir" OR "free ongkir") ' + 'OR "pembatasan gratis ongkir" OR "gratis ongkir dibatasi"' ) - query_html = escape(crawler_query) + + # Highlight keyword utama dengan warna biru + _QUERY_TERMS = [ + "komdigi", "ongkir", "gratis ongkir", "free ongkir", + "pembatasan gratis ongkir", "gratis ongkir dibatasi", + ] + query_highlighted = escape(crawler_query) + for term in _QUERY_TERMS: + escaped_term = escape(term) + query_highlighted = query_highlighted.replace( + escaped_term, + f'{escaped_term}', + 1, + ) st.markdown(f"""