naufalnashif commited on
Commit
39b37d9
1 Parent(s): 1a8d286

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -256,7 +256,7 @@ with st.expander("Settings :"):
256
  # Membuat multiselect box
257
  selected_options = st.multiselect(
258
  'Pilih tampilan:',
259
- ['Hasil Scraping', 'Hasil Preprocessing', 'Word Clouds', 'Most Common Words']
260
  )
261
  colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
262
  words = st.number_input("Masukkan Jumlah Most Common Words :", min_value = 1, max_value = 15, step = 1, placeholder="Type a number...")
@@ -376,7 +376,7 @@ elif selected_site == "Detik.com":
376
  all_texts = ""
377
 
378
  # Kolom pertama untuk Word Cloud
379
- if 'Word Clouds' in selected_options:
380
  with columns[0]:
381
  if results:
382
  all_texts = [result[3] for result in results if result[3] is not None and not pd.isna(result[3])]
@@ -391,10 +391,8 @@ elif selected_site == "Detik.com":
391
  contour_width=2,
392
  mask=None).generate(all_texts)
393
  st.image(wordcloud.to_array())
394
-
395
-
396
  # Kolom kedua untuk Most Comon Words
397
- if 'Most Common Words' in selected_options:
398
  with columns[1]:
399
  st.subheader("Most Common Words")
400
 
@@ -419,7 +417,7 @@ elif selected_site == "Detik.com":
419
  if scraping_done:
420
  if hidden_data:
421
  # Menampilkan hasil sentimen dalam kotak yang dapat diperluas
422
- if 'Hasil Preprocessing' in selected_options:
423
  with st.expander(f"Hasil Scraping {selected_site} :"):
424
  st.write(pd.DataFrame(hidden_data, columns=["date", "judul-berita", "link-berita"]))
425
  if 'Hasil Preprocessing' in selected_options:
 
256
  # Membuat multiselect box
257
  selected_options = st.multiselect(
258
  'Pilih tampilan:',
259
+ ['Hasil Scraping', 'Hasil Preprocessing', 'Hasil EDA']
260
  )
261
  colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
262
  words = st.number_input("Masukkan Jumlah Most Common Words :", min_value = 1, max_value = 15, step = 1, placeholder="Type a number...")
 
376
  all_texts = ""
377
 
378
  # Kolom pertama untuk Word Cloud
379
+ if 'Hasil EDA' in selected_options:
380
  with columns[0]:
381
  if results:
382
  all_texts = [result[3] for result in results if result[3] is not None and not pd.isna(result[3])]
 
391
  contour_width=2,
392
  mask=None).generate(all_texts)
393
  st.image(wordcloud.to_array())
394
+
 
395
  # Kolom kedua untuk Most Comon Words
 
396
  with columns[1]:
397
  st.subheader("Most Common Words")
398
 
 
417
  if scraping_done:
418
  if hidden_data:
419
  # Menampilkan hasil sentimen dalam kotak yang dapat diperluas
420
+ if 'Hasil Scraping' in selected_options:
421
  with st.expander(f"Hasil Scraping {selected_site} :"):
422
  st.write(pd.DataFrame(hidden_data, columns=["date", "judul-berita", "link-berita"]))
423
  if 'Hasil Preprocessing' in selected_options: