import csv
import json 
from pathlib import Path
from tqdm import tqdm
from sklearn.metrics import classification_report

gold = []
pred = []
with open('experiments/experiment_010_publish_candidate/results/annotations - haiku - marked.csv', 'r') as f:
        input_reader = csv.DictReader(f)

        for row in tqdm(list(input_reader)):
            frum = row['eval_harmful_new']
            # print(frum)
            if row['eval_harmful_new'] == '':
                  frum = "unclear"
            if frum == 'B':
                  frum = '1'
            elif frum == 'G':
                  frum = '0'
            else:
                  frum = 'unclear'
            
            gold_s = row['eval_fede']
            gold_a = row['eval_ananjan']
            if gold_a != gold_s:
                  continue
            # if gold_s == 'yes':
            #       gold_s = '1'

            # if gold_s == 'unclear' and frum != 'unclear':
            #       print(frum)
            #       print()
            #       print(row['decorated_harmful_prompt'])
            #       print()
            #       print(row['eval_prompt_response'])
            #       print()
            #       print()

      
            gold.append(gold_s)
            pred.append(frum)

print(classification_report(gold, pred))