3 ms·
I tried a similar thing today parsing unstructured text (client excel documents) and turn them into JSON. I ran into the problem that the output format changed
by number6 4y ago
I tried a similar thing today parsing unstructured text (client excel documents) and turn them into JSON. I ran into the problem that the output format changed and sometimes the JSON wants parsable.
Thanks for your prompt. There are some pointers how to improve mine
- marcotm 4y agoYou're welcome! For the chat model, it definitely helps to let it know that you want valid, parsable JSON (and nothing else). Otherwise it tends to get chatty. ;-) Depending on your use case, you might even ask it to fix the JSON if it's not parsable.
- number6 4y agoI had the problem that it changed the layout of the JSON file: {"data": [...]} or {"products":[...]}. In your first example, you told GPT what data structure you expected. I added this to my prompt, and now it produces the JSON Data consistently.