Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ st.title("SelfCheck scores")
|
|
10 |
|
11 |
@st.cache_data
|
12 |
def load_data(min_score=0.4, exclude_stories=True):
|
13 |
-
ds = load_dataset("
|
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"])
|
@@ -27,4 +27,11 @@ index = st.number_input(f'Found {len(ds)} samples, choose one', min_value=0, max
|
|
27 |
sample = ds[index]
|
28 |
st.markdown(f"**Passage Score:** {sample['passage_score']:.2f}, **seed data**: {sample['seed_data']}, **format**: {sample['format']}.")
|
29 |
st.markdown("---")
|
30 |
-
st.markdown(sample['original_text'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
@st.cache_data
|
12 |
def load_data(min_score=0.4, exclude_stories=True):
|
13 |
+
ds = load_dataset("loubnabnl/comsop_450_samples_detailed", 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"])
|
|
|
27 |
sample = ds[index]
|
28 |
st.markdown(f"**Passage Score:** {sample['passage_score']:.2f}, **seed data**: {sample['seed_data']}, **format**: {sample['format']}.")
|
29 |
st.markdown("---")
|
30 |
+
st.markdown(sample['original_text'])
|
31 |
+
|
32 |
+
# get inconsistent sentences
|
33 |
+
st.subheader("🤔 Sentences with a high inconsistency score")
|
34 |
+
sentences = sample["sentences_and_scores"]
|
35 |
+
sentences = [e for e in sentences if e["score"] > 0.5]
|
36 |
+
for s in sentences:
|
37 |
+
st.markdown(s['sentence'])
|