Spaces:
Sleeping
Sleeping
| import json | |
| with open("data/bigfive_questions_real.json", "r", encoding="utf-8") as f: | |
| data = json.load(f) | |
| enhanced_data = [] | |
| for item in data: | |
| reverse = "(R)" in item["question"] | |
| clean_question = item["question"].replace("(R)", "").strip() | |
| enhanced_data.append({ | |
| "id": item["id"], | |
| "trait": item["trait"], | |
| "question": clean_question, | |
| "reverse": reverse | |
| }) | |
| # Save to new file | |
| with open("data/bigfive_questions_cleaned.json", "w", encoding="utf-8") as f: | |
| json.dump(enhanced_data, f, indent=2, ensure_ascii=False) | |
| print("✅ Cleaned and saved to bigfive_questions_cleaned.json") | |