You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
2.7 KiB
Python
36 lines
2.7 KiB
Python
8 months ago
|
import pandas as pd
|
||
|
|
||
|
# 读取两个csv文件
|
||
|
human_score_df = pd.read_csv('logs/other/human.csv')
|
||
|
machine_score_df = pd.read_csv('logs/other/result_diff_test_score_53.84256314043283.csv')
|
||
|
|
||
|
result_df = pd.DataFrame(columns=['question', 'answer', 'predict_finetune', 'predict_origin', 'acc_finetune', 'human_acc_finetune', 'acc_origin', 'human_acc_origin', 'fluency_finetune', 'human_fluency_finetune', 'diff_score', 'human_diff_score'])
|
||
|
result_df_row_index = 0
|
||
|
for row_index, row in machine_score_df.iterrows():
|
||
|
acc_finetune_diff = row['acc_finetune'] - human_score_df.loc[row_index, '准确度(微调后']
|
||
|
acc_origin_diff = row['acc_origin'] - human_score_df.loc[row_index, '准确度(微调前']
|
||
|
fluency_finetune_diff = row['fluency_finetune'] - human_score_df.loc[row_index, '流畅度(微调后']
|
||
|
diff_score_diff = row['diff_score'] - human_score_df.loc[row_index, '是否超过原模型']
|
||
|
print("准确度(微调后)差值:", abs(acc_finetune_diff),end=' ')
|
||
|
print("准确度(微调前)差值:", abs(acc_origin_diff),end=' ')
|
||
|
print("流畅度(微调后)差值:", abs(fluency_finetune_diff),end=' ')
|
||
|
print("是否超过原模型差值:", abs(diff_score_diff))
|
||
|
if abs(acc_finetune_diff) >= 2:
|
||
|
result_df.loc[result_df_row_index, 'question'] = machine_score_df.loc[row_index, 'question']
|
||
|
result_df.loc[result_df_row_index, 'answer'] = machine_score_df.loc[row_index, 'answer']
|
||
|
result_df.loc[result_df_row_index, 'predict_finetune'] = machine_score_df.loc[row_index, 'predict_finetune']
|
||
|
result_df.loc[result_df_row_index, 'predict_origin'] = machine_score_df.loc[row_index, 'predict_origin']
|
||
|
result_df.loc[result_df_row_index, 'acc_finetune'] = machine_score_df.loc[row_index, 'acc_finetune']
|
||
|
result_df.loc[result_df_row_index, 'human_acc_finetune'] = human_score_df.loc[row_index, '准确度(微调后']
|
||
|
result_df.loc[result_df_row_index, 'acc_origin'] = machine_score_df.loc[row_index, 'acc_origin']
|
||
|
result_df.loc[result_df_row_index, 'human_acc_origin'] = human_score_df.loc[row_index, '准确度(微调前']
|
||
|
result_df.loc[result_df_row_index, 'fluency_finetune'] = machine_score_df.loc[row_index, 'fluency_finetune']
|
||
|
result_df.loc[result_df_row_index, 'human_fluency_finetune'] = human_score_df.loc[row_index, '流畅度(微调后']
|
||
|
result_df.loc[result_df_row_index, 'diff_score'] = machine_score_df.loc[row_index, 'diff_score']
|
||
|
result_df.loc[result_df_row_index, 'human_diff_score'] = human_score_df.loc[row_index, '是否超过原模型']
|
||
|
result_df_row_index += 1
|
||
|
|
||
|
|
||
|
result_df.to_csv('logs/other/diff.csv', index=False)
|
||
|
# 信息的准确性应当被首要考虑,多余的未知真假的信息不应该带来加分。
|