loubnabnl HF staff commited on
Commit
9e0865d
·
verified ·
1 Parent(s): f0ed0d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -9,14 +9,17 @@ st.title("SelfCheck scores")
9
 
10
 
11
  @st.cache_data
12
- def load_data(min_score=0.4):
13
  ds = load_dataset("HuggingFaceTB/hallucinations_450_samples_scores", split="train", token=HF_TOKEN, num_proc=2)
14
  ds = ds.filter(lambda x: x["passage_score"] >= min_score)
 
 
15
  return ds
16
 
17
 
18
  min_value = st.slider('Select minimum selfcheck score', 0.0, 1.0, 0.1, key='min_score')
19
- ds = load_data(min_score=min_value)
 
20
  index = st.number_input(f'Found {len(ds)} samples, choose one', min_value=0, max_value=len(ds)-1, value=0, step=1)
21
 
22
  # Load data based on slider values and checkbox status
 
9
 
10
 
11
  @st.cache_data
12
+ def load_data(min_score=0.4, exclude_stories=True):
13
  ds = load_dataset("HuggingFaceTB/hallucinations_450_samples_scores", split="train", token=HF_TOKEN, num_proc=2)
14
  ds = ds.filter(lambda x: x["passage_score"] >= min_score)
15
+ if exclude_stories:
16
+ ds = ds.filter(lambda x: "story" not in x["format"])
17
  return ds
18
 
19
 
20
  min_value = st.slider('Select minimum selfcheck score', 0.0, 1.0, 0.1, key='min_score')
21
+ exclude_stories = st.checkbox("Exclude stories", False)
22
+ ds = load_data(min_score=min_value, exclude_stories=exclude_stories)
23
  index = st.number_input(f'Found {len(ds)} samples, choose one', min_value=0, max_value=len(ds)-1, value=0, step=1)
24
 
25
  # Load data based on slider values and checkbox status