11 ms·
LLMs for structured input validation
There are several examples of structured outputs from LLMs; however, I'd like to use an language model to see if a given document / pdf adheres to a set template. Are there any good examples of this input validation use-case?
If the input doc / text doesn't adhere to the specific template, I'd like LLMs to point our the inconsistencies.
- ailef 2y agoWhat would be the advantage of using an LLM here? As opposed to parsing/validating the input using any other technique (of it's a well defined format, where you have e.g. a grammar).
- vismit2000 2y agoAgree with this. Just use Pydantic.
- MarcAntonyX 2y ago[dead]
- pizza 2y agoDepends on how fuzzy your definition of template is. If it's really structured, a simpler algorithm might work better. Otherwise maybe try https://github.com/Unstructured-IO/unstructured https://github.com/Unstructured-IO/unstructured
- luke-stanley 2y agoYou might want to try Instructor with llm_validator, where you can have natural language clauses to check against in a loop: https://python.useinstructor.com/blog/2023/10/23/good-llm-validation-is-just-good-validation/?h=good#software-30-validation-for-llms-or-powered-by-llms https://python.useinstructor.com/blog/2023/10/23/good-llm-va... With Pydantic too of course!