Skip to content
Snippets Groups Projects
Commit 8d6cd8db authored by zqwerty's avatar zqwerty
Browse files

update merge result format

parent 12db4129
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ def merge(dataset_name, speaker, save_dir, context_window_size, predict_result): ...@@ -15,7 +15,7 @@ def merge(dataset_name, speaker, save_dir, context_window_size, predict_result):
predict_result = json.load(open(predict_result)) predict_result = json.load(open(predict_result))
for sample, prediction in zip(data, predict_result): for sample, prediction in zip(data, predict_result):
sample['dialogue_acts_prediction'] = prediction['predict'] sample['predictions'] = {'dialogue_acts': prediction['predict']}
json.dump(data, open(os.path.join(save_dir, 'predictions.json'), 'w', encoding='utf-8'), indent=2, ensure_ascii=False) json.dump(data, open(os.path.join(save_dir, 'predictions.json'), 'w', encoding='utf-8'), indent=2, ensure_ascii=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment