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)