Skip to content

Commit

Permalink
Add binary examples for Textcat task in spacy-llm (#13051)
Browse files Browse the repository at this point in the history
* Add examples for binary classification.

* Fix example.

* Remove binary textcat example. Format.

* Rephrase.
  • Loading branch information
rmitsch authored Oct 11, 2023
1 parent 77c568e commit d72029d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions website/docs/api/large-language-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d72029d

Please sign in to comment.