File size: 1,827 Bytes
9f3bc09 |
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 52 53 54 55 56 57 58 59 60 61 62 |
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"\n",
" import json\n",
"\n",
" # Load the JSON file\n",
" file_path = 'your_file.json'\n",
" with open(file_path, 'r') as f:\n",
" data = json.load(f)\n",
"\n",
" # The structure contains:\n",
" # - data[0]: The evaluation question\n",
" # - data[1-3]: Three evaluation rounds with different complexity levels\n",
" # - data[4]: Final analysis and summary\n",
" # - data[5]: Full chat history\n",
"\n",
" # Extract evaluation results\n",
" question = data[0]\n",
" evaluations = []\n",
"\n",
" for item in data[1:4]: # The three evaluation rounds\n",
" eval_info = {\n",
" 'sub_aspect': item['Sub-aspect'],\n",
" 'tool': item['Tool'],\n",
" 'thought': item['Thought'],\n",
" 'average_score': item['eval_results']['score'][0],\n",
" 'detailed_results': item['eval_results']['score'][1]\n",
" }\n",
" evaluations.append(eval_info)\n",
"\n",
" # Extract individual video scores\n",
" for eval_round in evaluations:\n",
" print(f\"\\n{eval_round['sub_aspect']}:\")\n",
" for video in eval_round['detailed_results']:\n",
" print(f\" {video['prompt']}: {video['video_results']:.4f}\")\n",
"\n",
" # Get final analysis (if present)\n",
" if isinstance(data[4], dict) and 'Analysis' in data[4]:\n",
" final_analysis = data[4]['Analysis']\n",
" summary = data[4]['Summary']"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|