| import json |
| import matplotlib.pyplot as plt |
|
|
| |
| basic_path="/home/tianqiu/tts_schedule/batch_infer/results/mathhard/Qwen_Qwen2.5-7B-Instruct/Majority/output/acc4_new.jsonl" |
| parallel_path="/home/tianqiu/tts_schedule/batch_infer/results/mathhard/Qwen_Qwen2.5-7B-Instruct/Majority/output/acc8.jsonl" |
| sequence_vote_path="/home/tianqiu/tts_schedule/batch_infer/results/mathhard/Qwen_Qwen2.5-7B-Instruct/Sequence_vote/output_data/acc4_new.jsonl" |
|
|
| |
| with open(basic_path, 'r') as f: |
| basic_data = json.load(f) |
|
|
| with open(parallel_path, 'r') as f: |
| parallel_data = json.load(f) |
|
|
| with open(sequence_vote_path, 'r') as f: |
| sequence_vote_data = json.load(f) |
|
|
| |
| correct_indices_basic = basic_data['correct_indices'] |
| correct_indices_parallel = parallel_data['correct_indices'] |
| correct_indices_sequence_vote = sequence_vote_data['correct_indices'] |
|
|
| |
| intersection = set(correct_indices_parallel) & set(correct_indices_sequence_vote) |
|
|
| |
| basic_in_intersection = set(correct_indices_basic) & intersection |
| intersection_not_basic = intersection - set(correct_indices_basic) |
|
|
| |
| print(f"Intersection: {len(intersection)}") |
| print(f"Parallel not in Sequence vote: {len(correct_indices_parallel) - len(intersection)}") |
| print(f"Sequence vote not in Parallel: {len(correct_indices_sequence_vote) - len(intersection)}") |
| print(f"Basic in intersection: {len(basic_in_intersection)}") |
| print(f"Intersection not in basic: {len(intersection_not_basic)}") |
|
|
| |
| plt.figure(figsize=(10, 8)) |
| plt.pie([len(basic_in_intersection), len(intersection_not_basic), |
| len(correct_indices_parallel) - len(intersection), |
| len(correct_indices_sequence_vote) - len(intersection)], |
| labels=['Basic in Intersection', 'Intersection not in Basic', |
| 'Parallel not in Sequence vote', 'Sequence vote not in Parallel'], |
| autopct='%1.1f%%', |
| colors=['#ff9999', '#66b3ff', '#99ff99', '#ffcc99']) |
| plt.title('Comparison of Correct Answers Across Different Methods') |
| plt.axis('equal') |
| plt.show() |