diff --git a/website/docs/api/large-language-models.mdx b/website/docs/api/large-language-models.mdx index f8404cb2e..55d137e21 100644 --- a/website/docs/api/large-language-models.mdx +++ b/website/docs/api/large-language-models.mdx @@ -752,6 +752,25 @@ supports `.yml`, `.yaml`, `.json` and `.jsonl`. path = "textcat_examples.json" ``` +If you want to perform few-shot learning with a binary classifier (i. e. a text +either should or should not be assigned to a given class), you can provide +positive and negative examples with answers of "POS" or "NEG". "POS" means that +this example should be assigned the class label defined in the configuration, +"NEG" means it shouldn't. E. g. for spam classification: + +```json +[ + { + "text": "You won the lottery! Wire a fee of 200$ to be able to withdraw your winnings.", + "answer": "POS" + }, + { + "text": "Your order #123456789 has arrived", + "answer": "NEG" + } +] +``` + ### REL {id="rel"} The REL task extracts relations between named entities.