diff --git a/src/configuration.py b/src/configuration.py index 5d69d91..ab8477c 100644 --- a/src/configuration.py +++ b/src/configuration.py @@ -179,7 +179,13 @@ Ensure to generate only the JSON output with content in English. # for key in data: # example[key] = data[key] - config["length"] = random.choice([5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 40, 60, 80, 100, 150]) + num_query_word = [5, 5, 6, 6, 7, 7, 8, 9, 10, 12, 14, 16, 18, 20, 40, 60, 80, 100, 150] + while True: + config["length"] = random.choice(num_query_word) + if config["length"] * 3 < len(passage): + break + if config["length"] == min(num_query_word): + break return config