Having issues with grammar check using API (with paid subscription)

Hello,

Sometimes getting only a word or weird responses when trying to fix german grammar errors using text-davinci-003 model.

Prompt used: “Fix grammar in this German sentence: (sentence)”

An example of wrong response from API:
Prompt: “Fix grammar in this German sentence: Er hat gesagt dass sie ist zu spät”
Result: kommen würde
Result should be the whole sentence with grammar fixes, sometimes it is not.

Is it normal with paid subscription?

Maybe you can reword your prompt, for example:

Correct the grammar in the following German sentence and reply with the entire sentence: Er hat gesagt dass sie ist zu spät

Example completion:

FYI, tried the above for you 10 times @rearm and got the same results consistently.

HTH

:slight_smile:

1 Like

Thanks for the help! I’m trying with different prompts now, but looks like now it’s returning empty response mostly. Also tried temperature 0.9 but nothing changed.

Using NodeJS to call completion api:

    const response = await openai.createCompletion({
      model: "text-davinci-003",
      prompt: `Correct the grammar in the following German sentence and reply with the entire sentence: ${text}`,
      temperature: 0,
      max_tokens: 60,
      top_p: 1,
      frequency_penalty: 0,
      presence_penalty: 0,
  });
    console.log(response.data.choices[0].text.trim())

For the example above, prompt the result is same as yours which is exactly it should be.

But for “Correct the grammar in the following German sentence and reply with the entire sentence: er hat gesagt dass sie ist zu spat” the response is always empty;

choices: [ { text: ‘’, index: 0, logprobs: null, finish_reason: ‘stop’ } ],
usage: { prompt_tokens: 66, total_tokens: 66 }

Any ideas? :neutral_face:

Yes. Add a stop param like

####

And see how that goes.

:slight_smile: