by simonw · 2y ago · 0 comments
This means you can now use gpt-4-turbo vision to extract structured data from an image!
I was previously using a nasty hack where I'd run the image through the vision model to extract just the text, then run that text through regular gpt-4-turbo to extract structured data. I ditched that hack just now: https://github.com/datasette/datasette-extract/issues/19
I'm trying it for coding and have added it to my VS Code Copilot extension Overall I'd say it's better at coding than the previous GPT-4 Turbo. https://double.bot if anyone wants to try it :)
How consistent and reliable is the extracted structure?
Did they add any kind of concept "for whatever token you generate/think it is next, "unit test it" / make sure it passes some sort of rules?"
Same story as basically everything relating to LLMs to be honest.
https://github.com/ggerganov/llama.cpp/blob/master/grammars/...
I've found success generally better with Textract and then passing the OCR'ed text to OpenAI and using Pydantic to get it structured.
I'm not 100% sure it's related but if you ask it to draw bounding boxes around things it's always off by quite a bit.
That's the $100B question.
Have you noticed GPT-4 Vision do weird selections of dates for 2019? In doing some processing of some data for work, I ended up switching to textract and then passing the OCR'ed text to GPT-4 and mapping to a Pydantic schema due to this issue.