loubnabnl HF staff commited on
Commit
2865184
1 Parent(s): dab4dfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -16,19 +16,19 @@ Additionally, the model was tasked with finding the topic of each cluster.
16
  """)
17
 
18
  @st.cache_data
19
- def load_data(min_score=1, max_score=10):
20
  ds = load_dataset("HuggingFaceTB/FW_clusters_free_topics", split="train", token=HF_TOKEN, num_proc=2)
21
  ds = ds.filter(lambda x: x['educational_score'] <= max_score and x['educational_score'] >= min_score)
22
  return ds
23
 
24
  st.subheader("Cluster information")
25
- min_score, max_score = st.columns(2)
26
- with min_score:
27
  min_value = st.slider('Select minimum educational score', 1, 10, 1, key='min_score')
28
- with max_score:
29
  max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
30
 
31
- ds = load_data(min_score, max_score)
32
  selected_category_type = st.selectbox("Select a topic", categories)
33
  categories = list(set(ds["category"]))
34
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)
 
16
  """)
17
 
18
  @st.cache_data
19
+ def load_data(min=1, max=10):
20
  ds = load_dataset("HuggingFaceTB/FW_clusters_free_topics", split="train", token=HF_TOKEN, num_proc=2)
21
  ds = ds.filter(lambda x: x['educational_score'] <= max_score and x['educational_score'] >= min_score)
22
  return ds
23
 
24
  st.subheader("Cluster information")
25
+ col_1, col_2 = st.columns(2)
26
+ with col_1:
27
  min_value = st.slider('Select minimum educational score', 1, 10, 1, key='min_score')
28
+ with col_2:
29
  max_value = st.slider('Select maximum educational score', 1, 10, 10, key='max_score')
30
 
31
+ ds = load_data(min_value, max_value)
32
  selected_category_type = st.selectbox("Select a topic", categories)
33
  categories = list(set(ds["category"]))
34
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)