What's the best way to clean GPT output.
I'm using the complete my sentence with prefix prompting technique with GPT-4, but sometimes the output doesn't have my prefix, or is quoted... Is there a standard method to clean these output?
Add a bunch of examples to the GPT column without the quotation marks and with the full sentence you want at the start of the output, 3-5 should do it. If it's still giving you wrong outputs even after that just use a formula
Hey, thanks for reaching out, and sorry for the delay! In such cases, you can add a separate formula column asking it to clean the response from chatGPT. If you're using chatGPT 4-turbo, then I'd approach it how Rubi S. suggested, adding many examples. That model's token limit goes up to 128k tokens... Of course, depending on how long your current prompt is, the other models should be able to handle it too.
Adding on to what others have said, in a case like this tell it to strip all single and double quotes out of the output (sometimes 2 times in a prompt) and it seems to work well.
Also, if you can avoid it, don't use quotes in the prompt itself.