Does anybody want a tool to turn raw data (web-scraped or anything) into JSON?
I am currently evaluating whether to launch a simple yet effective tool that converts your data into a well-structured JSON. If there is a need for this type of tool, I can develop it.
Let me know your thoughts about it :)
13 comments
[ 4.7 ms ] story [ 43.1 ms ] threadMaybe follow how jq and things like beautiful soup work?
Example Data: John is 25 years old and studies computer science at university. His address is 123 Main St, Anytown 12345
Format that you want will look something like this,
{ "format": { "name": { "type": "string" }, "age": { "type": "number" }, "isStudent": { "type": "boolean" }, "courses": { "type": "array", "items": { "type": "string" } }, "address": { "type": "object", "properties": { "street": { "type": "string" }, "city": { "type": "string" }, "zipcode": { "type": "string" } } } } }
------
Output,
{ "name": "John", "age": 25, "isStudent": true, "courses": ["computer science"], "address": { "properties": { "street": "123 Main St", "city": "Anytown", "zipcode": "12345" } } }
{ "data": "Title: The Effects of Sleep on Memory, Authors: Dr. Jane Doe, Dr. John Smith, Publication Date: 2022-09-15, Journal: Journal of Neuroscience, Abstract: This study explores how sleep influences memory consolidation. Our research indicates that participants who had a full night's sleep performed better on memory tests compared to those who did not. Keywords: sleep, memory, neuroscience, cognition", "format": { "title": { "type": "string" }, "authors": { "type": "array", "items": { "type": "string" } }, "publicationDate": { "type": "string" }, "journal": { "type": "string" }, "abstract": { "type": "string" }, "keywords": { "type": "array", "items": { "type": "string" } } } }
or it can be an HTML, or general text document, or an article pdf whatever
Expected Output will be this,
{ "title": "The Effects of Sleep on Memory", "authors": [ "Dr. Jane Doe", "Dr. John Smith" ], "publicationDate": "2022-09-15", "journal": "Journal of Neuroscience", "abstract": "This study explores how sleep influences memory consolidation. Our research indicates that participants who had a full night's sleep performed better on memory tests compared to those who did not.", "keywords": [ "sleep", "memory", "neuroscience", "cognition" ] }
Let me know what you think ^_^
Also most clients are designed to handle JSON perfectly and they have trouble with parsing JSON. And what if there's colons in other lines.
So a YAML to JSON tool would be nice. And better if there's some error correction. Currently, I'm manually writing the error correction, and sometimes it corrects things that aren't errors.
However, knowing AI, it could be possible that AIs would output JSON perfectly fine next week. I know OpenAI Assistants can do this to an extent and Gemini seems to be doing it okay.
However, my implementation (not entirely mine btw) will ensure that whatever the user gets as an output is a valid & type-safe JSON response; otherwise, it will throw an error.
I’ve built a few of these with OpenAI function calling and it seems to do a pretty good job. I have yet to convert those over to open source models but doable.
Once you build it let me know I can help you test it out.