3 ms·
Well it depends what you are generating from, but this does raise a good point/principle. I think "Use traditional code for as long as possible" is a good rule
by DeadlyPretzel 3y ago
Well it depends what you are generating from, but this does raise a good point/principle.
I think "Use traditional code for as long as possible" is a good rule to follow as well.
Let's say you are generating JSON from scraped job offerings so you can insert them into a job-finding database. If these job offerings all come from one place and follow a specific format, DEFINITELY use traditional code, LLMs can't do a better job than that!
However if you are getting them from multiple places, emails, linkedin, ... and they don't follow a set structure, using traditional code to extract any meaningful data would be utterly hopeless without an LLM
So, the only option really is asking the LLM to generate some highly-structured (JSON) data for you based on the unstructured job offer.
In this particular use-case though I would go toward using the Guidance library very, very quickly as it doesn't let me down for cases where I need to generate JSON like this.
In fact, I am working on an article that goes through this exact use-case and my reasoning step by step, which triggered me to write the Defensive AI Design article first as I noticed I had built up a very specific set of rules/workflow that I almost always follow
EDIT: Additionally, I'd say that if you can keep the AI generation to a minimum, and only fill in what you can't with traditional code, then go for it!
If you can programmatically extract the job title, date of posting, but you need AI to extract the required skills & education, then that's the best route to take IMHO