Is there a way to use AI just to do something in especific?

Hi. I will be short. I upload an invoice image and a prompt to Gemini with a script from Python and receive a JSON schema given in the prompt from that. How can I train the model in future on cases like, for example, “It’s not a “5”, it’s a “$” symbol” so I don’t need to change the prompt?.
Thank you!

1 Like

Welcome to the forum.

One approach you might try is to give the model a few samples with the answer you expect to get in the prompt, before the image you want it to really process. So, your prompt would have a sequence of Part, with the last Part holding the image you want handled, and the model will complete the sequence by doing what it saw getting done two-three times before. The few-shot prompting technique is quite effective. Obviously, use samples that illustrate the edge cases you care about, such as the 5 vs $ case you described.

Hope that helps.

1 Like