loubnabnl HF staff commited on
Commit
01206ed
1 Parent(s): f5985dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -34,16 +34,16 @@ def load_data(min_score=1, max_score=10, show_special=False):
34
  st.subheader("Cluster information")
35
  col_1, col_2, col_3 = st.columns(3)
36
  with col_1:
37
- min_value = st.slider('Select minimum educational score', 1, 10, 1, key='min_score')
38
  with col_2:
39
- max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
40
  with col_3:
41
- show_special = st.checkbox('Show only clusters with undefined educational score', False)
42
 
43
  # Load data based on slider values and checkbox status
44
  ds = load_data(min_value, max_value, show_special)
45
- selected_category_type = st.selectbox("Select a topic", categories)
46
  categories = list(set(ds["category"]))
 
47
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)
48
 
49
  # Select sample index
@@ -59,6 +59,7 @@ if n_samples > 0:
59
  index_example = st.number_input(f"Found {len(files)} files in the cluster, choose one", min_value=0, max_value=len(files)-1, value=0, step=1)
60
 
61
  sample = files[index_example]
 
62
  st.markdown(sample)
63
  else:
64
  st.markdown("No files found, change the cluster.")
 
34
  st.subheader("Cluster information")
35
  col_1, col_2, col_3 = st.columns(3)
36
  with col_1:
37
+ show_special = st.checkbox('Show only clusters with undefined educational score', False)
38
  with col_2:
39
+ min_value = st.slider('Select minimum educational score', 1, 10, 1, key='min_score')
40
  with col_3:
41
+ max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
42
 
43
  # Load data based on slider values and checkbox status
44
  ds = load_data(min_value, max_value, show_special)
 
45
  categories = list(set(ds["category"]))
46
+ selected_category = st.selectbox("Select a topic", categories)
47
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)
48
 
49
  # Select sample index
 
59
  index_example = st.number_input(f"Found {len(files)} files in the cluster, choose one", min_value=0, max_value=len(files)-1, value=0, step=1)
60
 
61
  sample = files[index_example]
62
+ st.markdown(f"**Topic educational score**: {sample['educational_score']}")
63
  st.markdown(sample)
64
  else:
65
  st.markdown("No files found, change the cluster.")