-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblah2.py
More file actions
36 lines (33 loc) · 1.06 KB
/
blah2.py
File metadata and controls
36 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
num_sentences = 0
num_facts = 0
total_sentences = 0
sentences_with_correct_facts = 0
with open("./output/facts.txt", "r") as f:
lines = f.readlines()
total_sentences = len(lines)
for line in lines:
if line.strip() == "" or "|" not in line:
continue
original, *facts = line.split("|")
num_sentences += 1
if len(facts) == 0:
continue
if len(facts) == 1 and facts[0].strip() == "":
continue
num_facts += len(facts)
print(f"At {num_sentences}/{total_sentences}")
print(f"Original: {original}")
if len(facts) == 1:
print(f"Fact: {facts[0]}")
else:
print(f"Facts:")
for fact in facts:
print(f"\t- {fact}")
is_correct = input("Is this correct? (y/n): ")
if is_correct == "y":
print("Correct")
sentences_with_correct_facts += 1
else:
print("Incorrect")
print(f"s {num_sentences} f {num_facts} scf {sentences_with_correct_facts}")
print()