Extracting financial disclosure and police reports with OpenAI Structured Output
11–20 of 93 posts
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#12Stuff like this shows how much better the commercial models are than local models. I’ve been playing around with fairly simple structured information extraction from news articles and fail to get any kind of consistent behavior from llama3.1:8b. Claude and chatGPT do exactly what I want without fail.
Llama isn't on there but a few finetunes of it (Hermes) are OSS.
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#13Made a small project to help extract structure from documents (pdf,jpg,etc -> JSON or CSV): https://datasqueeze.ai/ There's 10 free pages to extract if anyone wants to give it a try. I've found that just sending a pdf to models doesn't extract it properly especially with longer documents. Have tried to incorporate all best practices into this tool. It's a pet project for now. Lmk if you find it helpful!
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#14Stuff like this shows how much better the commercial models are than local models. I’ve been playing around with fairly simple structured information extraction from news articles and fail to get any kind of consistent behavior from llama3.1:8b. Claude and chatGPT do exactly what I want without fail.
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#15> Note that this example simply passes a PNG screenshot of the PDF to OpenAI's API — results may be different/more efficient if you send it the actual PDF. OpenAI's API only accepts images: https://platform.openai.com/docs/guides/vision To my knowledge, all the LLM services that take in PDF input do their own text extraction of the PDF before feeding it to an LLM.
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#16> Note that this example simply passes a PNG screenshot of the PDF to OpenAI's API — results may be different/more efficient if you send it the actual PDF. OpenAI's API only accepts images: https://platform.openai.com/docs/guides/vision To my knowledge, all the LLM services that take in PDF input do their own text extraction of the PDF before feeding it to an LLM.
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#17Cool work! Correct me if I'm wrong, but I believe to use the new OpenAI structured output that's more reliable, the response_format should be "json_schema" instead of "json_object". It's been a lot more robust for me.
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#18Cool work! Correct me if I'm wrong, but I believe to use the new OpenAI structured output that's more reliable, the response_format should be "json_schema" instead of "json_object". It's been a lot more robust for me.
I’ve been using jsonschema since forever with function calling. Does structured output just formalize things?
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#19Cool work! Correct me if I'm wrong, but I believe to use the new OpenAI structured output that's more reliable, the response_format should be "json_schema" instead of "json_object". It's been a lot more robust for me.
openai.BadRequestError: Error code: 400 - {'error': {'message': "Missing required parameter: 'response_format.json_schema'.", 'type': 'invalid_request_error', 'param': 'response_format.json_schema', 'code': 'missing_required_parameter'}}
I hadn't used OpenAI for data extraction before the announcement of Structured Outputs, so not sure if `type: json_object` did something different before. But supplying only it as the response format seems to be the (low effort) way to have the API infer the structure on its own[0] https://platform.openai.com/docs/guides/structured-outputs/s...
Re: Extracting financial disclosure and police reports with OpenAI Structured Output
#20Stuff like this shows how much better the commercial models are than local models. I’ve been playing around with fairly simple structured information extraction from news articles and fail to get any kind of consistent behavior from llama3.1:8b. Claude and chatGPT do exactly what I want without fail.
I mean, those aren't comparable models. I wonder how the 405b version compares.