forked from batubayk/enc_dec_sum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qualitative_analysis.py
52 lines (40 loc) · 1.92 KB
/
qualitative_analysis.py
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
import pandas as pd
from pathlib import Path
from numpy import random
random.seed(35)
idx=random.randint(10000, size=(50))
print(idx)
home_path = Path("/Users/bbaykara/Desktop/results")
'''
dataset = "tr_news"
task = "summary"
models = ["mt5", "mbart", "berturk32k", "berturk32k_cased", "mbert_uncased", "mbert_cased"]
checkpoints = ["checkpoint-60718","checkpoint-43370","checkpoint-52050","checkpoint-52050","checkpoint-69400","checkpoint-78075"]
dataset = "tr_news"
task = "title"
models = ["mt5", "mbart", "berturk32k", "berturk32k_cased", "mbert_uncased", "mbert_cased"]
checkpoints = ["checkpoint-52044","checkpoint-34696","checkpoint-52044","checkpoint-34696","checkpoint-52044","checkpoint-60718"]
dataset = "ml_sum"
task = "title"
models = ["mt5", "mbart", "berturk32k", "berturk32k_cased", "mbert_uncased", "mbert_cased"]
checkpoints = ["checkpoint-38950","checkpoint-31160","checkpoint-38950","checkpoint-31160","checkpoint-38950","checkpoint-38950"]
'''
dataset = "ml_sum"
task = "summary"
models = ["mt5", "mbart", "berturk32k", "berturk32k_cased", "mbert_uncased", "mbert_cased"]
checkpoints = ["checkpoint-62320","checkpoint-15580","checkpoint-46740","checkpoint-31160","checkpoint-46740","checkpoint-62320"]
results = {}
for model, checkpoint in zip(models,checkpoints):
path = home_path.joinpath(dataset, task , dataset + "_" + model + "_" + task ,checkpoint,"text_outputs.csv")
results[model] = pd.read_csv(path).iloc[idx]
for i in idx:
print("**************************************************************")
print("ID",i)
print("------------------------ SOURCE ------------------------")
print(results["mt5"].loc[i]['source'])
print("------------------------ REFERENCE ------------------------")
print(results["mt5"].loc[i]['target'])
for model in models:
print("------------------------"+model+"------------------------")
print(results[model].loc[i]['predictions'])
print()