Fix API docs.

This commit is contained in:
Raphael Mitsch 2023-12-05 16:10:12 +01:00
parent 6dce83f326
commit 72ae1dd573

View File

@ -236,18 +236,15 @@ objects. This depends on the return type of the [model](#models).
| `responses` | The generated prompts. ~~Iterable[Any]~~ | | `responses` | The generated prompts. ~~Iterable[Any]~~ |
| **RETURNS** | The annotated documents. ~~Iterable[Doc]~~ | | **RETURNS** | The annotated documents. ~~Iterable[Doc]~~ |
### Summarization {id="summarization"} ### Raw prompting {id="raw"}
A summarization task takes a document as input and generates a summary that is Different to all other tasks `spacy.Raw.vX` doesn't provide a specific prompt,
stored in an extension attribute.
#### spacy.Raw.v1 {id="raw-v1"}
Different to all other tasks `spacy.Raw.v1` doesn't provide a specific prompt,
wrapping doc data, to the model. Instead it instructs the model to reply to the wrapping doc data, to the model. Instead it instructs the model to reply to the
doc content. This is handy for use cases like question answering (where each doc doc content. This is handy for use cases like question answering (where each doc
contains one question) or if you want include customized prompts for each doc. contains one question) or if you want include customized prompts for each doc.
#### spacy.Raw.v1 {id="raw-v1"}
Note that since this task may request arbitrary information, it doesn't do any Note that since this task may request arbitrary information, it doesn't do any
parsing per se - the model response is stored in a custom `Doc` attribute (i. e. parsing per se - the model response is stored in a custom `Doc` attribute (i. e.
can be accessed via `doc._.{field}`). can be accessed via `doc._.{field}`).
@ -300,6 +297,11 @@ field = "llm_reply"
path = "raw_examples.yml" path = "raw_examples.yml"
``` ```
### Summarization {id="summarization"}
A summarization task takes a document as input and generates a summary that is
stored in an extension attribute.
#### spacy.Summarization.v1 {id="summarization-v1"} #### spacy.Summarization.v1 {id="summarization-v1"}
The `spacy.Summarization.v1` task supports both zero-shot and few-shot The `spacy.Summarization.v1` task supports both zero-shot and few-shot