import pandas
from scipy.stats import spearmanr, pearsonr, kendalltau

woref = pandas.read_csv('outputs/woref_bert-human_overall_rank_correlation.csv')
wref = pandas.read_csv('outputs/wref_bert-human_overall_rank_correlation.csv')

article_set = set(woref['article'].tolist())

for article in article_set:
    woref_scores = woref[woref['article']==article]['metric_score'].tolist()
    wref_scores = wref[woref['article']==article]['metric_score'].tolist()
    human_scores = wref[woref['article']==article]['human_score'].tolist()

    print('\n ===article {}==='.format(article))
    print('woref scores: {}'.format(woref_scores))
    print('wref scores: {}'.format(wref_scores))
    print('woref pearson: {}'.format(pearsonr(woref_scores,human_scores)[0]))
    print('wref pearson: {}'.format(pearsonr(wref_scores,human_scores)[0]))
