-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis.py
More file actions
21 lines (20 loc) · 1.06 KB
/
analysis.py
File metadata and controls
21 lines (20 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from agent.utils import load_jsonl
import ipdb
org_output = load_jsonl("./output/output_wo_llm_text.jsonl")
new_output = load_jsonl("./output_workflow_desc_w_org_prompt/output_wo_llm_text.jsonl")
# sort by turn id
org_output = sorted(org_output, key=lambda x: x["turn_id"])
new_output = sorted(new_output, key=lambda x: x["turn_id"])
for i in range(len(org_output)):
org_response = org_output[i]["response"]
new_response = new_output[i]["response"]
context = "\n".join([f"{item['role']}: {item['content']}" for item in org_output[i]["messages"]])
if org_response["action"] == "stay" and new_response["action"] != "stay" and org_output[i]["answer_type"] == "UNK":
print(f"Org id: {org_output[i]['turn_id']}")
print(f"New id: {new_output[i]['turn_id']}")
print(f"Context: {context}")
print(f"Answer: {org_output[i]['answer']}")
print(f"Last workflow: {org_output[i]['last_turn_workflow']}")
print(f"New response: {new_response['reason']}")
print(f"Org response: {org_response['reason']}")
ipdb.set_trace()