import json
import random

# Load the JSON file
groundTruth_file_name = 'output.json'
shuffled_file_name = 'shuffle_tool_query_ToolLens.json'

with open(groundTruth_file_name, 'r') as f:
    groundTruth = json.load(f)

# Shuffle the items in the JSON file (assuming the content is a list)
random.shuffle(groundTruth)

# Write the shuffled data to a new file
with open(shuffled_file_name, 'w') as f:
    json.dump(groundTruth, f, indent=4)

print(f"Shuffled data has been written to {shuffled_file_name}")

