File size: 1,444 Bytes
90cd92a |
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
import jsonlines
# Path to your JSONL file
file_path = '/fsx/ivan.laptev/Deepfake/deepfakehtml/my_code/json/llavatestanswersdffd13.jsonl'
# Open and read the JSONL file
i = 0
total = 0
correct=0
correct2=0
correct3=0
total2 = 100
# with jsonlines.open(file_path) as reader:
# for obj in reader:
# # Access the values in each JSON object
# # print(obj['text'])
# ans="0"
# if (i>99):
# ans="2"
# if (i>199):
# ans="3"
# if (i>299):
# ans="1"
# if (ans==obj['text']):
# correct+=1
# # if (i<=299):
# # total+=1
# total+=1
# i+=1
with jsonlines.open(file_path) as reader:
for obj in reader:
# Access the values in each JSON object
# print(obj['text'])
ans="No."
ans2="0"
if (i>999):
ans="Yes."
ans2="100"
# if (i>199):
# ans="No"
# ans2="Deepfake"
# if (i>299):
# ans="bruh"
# ans2="Dbruh"
if (ans==obj['text'] or ans2==obj['text']):
correct+=1
if (i>1000):
correct2+=1
if(i<=1000):
correct3+=1
# if (i<=99 or (i>199 and i <=299)):
# total+=1
# total+=1
i+=1
print(correct/i)
# print(correct2)
# print(total2)
print(correct2/(i-1000))
print((correct3)/1000) |