Search code examples
openai-apigpt-3

how can i use openai's gpt 3 to find alternate spellings of bad words?


so, i am making an auto mod discord bot that finds alternate spellings of bad words. i tried using regex to find them but found many many false positives. so i thought about using openai's gpt-3 to do so, as i saw a screenshot of someone using it for what appears to be finding alternate spellings.

the screenshot:

the screenshot:

unfortunately, i don't know how exactly they made gpt-3 do this, and how something like this can be used in an application like a discord bot.

can someone please tell me how you can use gpt-3 to find alternate spellings of words?

any help would be appreciated! thank you!


Solution

  • I am not sure if you are looking for prompt/settings. However, based on my experience (3-4 months) I would use a few-shot approach prompt such this one:

    Check spelling and return the corrected word:
    Word: nawty
    Returns: naughty
    Word: rigt
    Returns: right
    Word: stakoverflow
    Returns: 
    

    I guess that a high temperature and no penalties will do a good job. Also, keep trying different engines and see how it behaves. Curie-instruct-beta should do it.