Just use a LLM api to generate results, it will be far better and more accurate than a weird home cooked algorithm