Skip to content
Snippets Groups Projects
Commit eedb08cc authored by Hsien-Chin Lin's avatar Hsien-Chin Lin
Browse files

wip

parent 5bedcba1
No related branches found
No related tags found
No related merge requests found
...@@ -224,6 +224,7 @@ class Evaluator: ...@@ -224,6 +224,7 @@ class Evaluator:
print(f"{metric}: {result[metric]}") print(f"{metric}: {result[metric]}")
result["dialog"] = dialog_result result["dialog"] = dialog_result
basename = "semantic_evaluation_result" basename = "semantic_evaluation_result"
json.dump(result, open(os.path.join( json.dump(result, open(os.path.join(
self.model_checkpoint, f"{self.dataset}-{basename}.json"), 'w')) self.model_checkpoint, f"{self.dataset}-{basename}.json"), 'w'))
...@@ -241,7 +242,7 @@ def emotion_score(golden_emotions, gen_emotions): ...@@ -241,7 +242,7 @@ def emotion_score(golden_emotions, gen_emotions):
confusion_matrix=cm, display_labels=labels) confusion_matrix=cm, display_labels=labels)
disp.plot() disp.plot()
plt.savefig("emotion.png") plt.savefig("emotion.png")
r = {"macro_f1": macro_f1, "sep_f1": list( r = {"macro_f1": float(macro_f1), "sep_f1": list(
sep_f1), "cm": [list(c) for c in list(cm)]} sep_f1), "cm": [list(c) for c in list(cm)]}
print(r) print(r)
return r return r
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment