How do I reduce the probability of getting "unknown" when using the classification endpoint

Presumably there is some threshold below which the classification endpoint returns “unknown”. How do I lower this threshold?

response = openai.Classification.create(

        examples= [

            ["man1","man"],

            ["woman1","woman"],

            ["lady","woman"],

            ["girl","girl"],

            ["boy","boy"],

            ["kid1","boy"],

            ["kid","boy"],

        ],

        labels=["man","woman","girl","boy"],

        query= c,

        search_model= "ada",

        model= "curie",

    )

The Unknown tag appears when the API generates a label that isn’t in your examples or labels. If you want to see what label is getting generated, I would suggest either passing in return_prompt=True to see the prompt that is being generated (and then trying that out on the playground)

To directly answer your question, if you want to make it more like to generate one of your labels, try adjusting the logit_bias for your tokens as outlined in OpenAI API

What about using the “labels” argument, is it preventing “unknown”?

EDIT: what happen if using a file + labels argument?