| from benchmark.synthetic_data import generate_synthetic_dataset | |
| def test_synthetic_data_generation(): | |
| text, questions, facts = generate_synthetic_dataset( | |
| style="random_kv", | |
| target_tokens=1000, | |
| num_facts=2, | |
| num_questions=2, | |
| placement="middle", | |
| seed=100 | |
| ) | |
| assert len(text) > 0 | |
| assert len(questions) == 2 | |
| assert len(facts) == 2 | |
| for q in questions: | |
| assert "question_id" in q | |
| assert "question" in q | |
| assert "expected_answer" in q | |
| assert "source_position" in q | |
| assert 0.0 <= q["source_position"] <= 1.0 | |