Add binary examples for Textcat task in spacy-llm (#13051)

* Add examples for binary classification.

* Fix example.

* Remove binary textcat example. Format.

* Rephrase.

(cherry picked from commit d72029d9c8)
This commit is contained in:
Raphael Mitsch 2023-10-11 12:23:38 +02:00
parent b627f952bb
commit 8897621db9

View File

@ -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.