mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Add binary examples for Textcat task in spacy-llm
(#13051)
* Add examples for binary classification. * Fix example. * Remove binary textcat example. Format. * Rephrase.
This commit is contained in:
parent
77c568e524
commit
d72029d9c8
|
@ -752,6 +752,25 @@ supports `.yml`, `.yaml`, `.json` and `.jsonl`.
|
||||||
path = "textcat_examples.json"
|
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"}
|
### REL {id="rel"}
|
||||||
|
|
||||||
The REL task extracts relations between named entities.
|
The REL task extracts relations between named entities.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user