loubnabnl HF staff commited on
Commit
95fe8fe
·
verified ·
1 Parent(s): 5845f52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -16,13 +16,13 @@ Additionally, the model was tasked with finding the topic of each cluster.
16
  """)
17
 
18
  @st.cache_data
19
- def load_data(educational_topic, 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
-
25
  st.subheader("Cluster information")
 
26
  min_score, max_score = st.columns(2)
27
  with min_score:
28
  min_value = st.slider('Select minimum educational score', 1, 10, 1)
@@ -31,9 +31,6 @@ with max_score:
31
 
32
  ds = load_data(educational_topic, min_score, max_score)
33
  categories = list(set(ds["category"]))
34
-
35
- selected_category_type = st.selectbox("Select a topic", categories)
36
-
37
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)
38
 
39
  # Select sample index
 
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
+ selected_category_type = st.selectbox("Select a topic", categories)
26
  min_score, max_score = st.columns(2)
27
  with min_score:
28
  min_value = st.slider('Select minimum educational score', 1, 10, 1)
 
31
 
32
  ds = load_data(educational_topic, min_score, max_score)
33
  categories = list(set(ds["category"]))
 
 
 
34
  selected_cluster = ds.filter(lambda x: x['category'] == selected_category)
35
 
36
  # Select sample index