mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-11 08:42:28 +03:00
waltzing schedule
This commit is contained in:
parent
b96cd9fa5e
commit
7d9f00bdbf
|
@ -282,17 +282,18 @@ concept of function registries. spaCy also uses the function registry for
|
||||||
language subclasses, model architecture, lookups and pipeline component
|
language subclasses, model architecture, lookups and pipeline component
|
||||||
factories.
|
factories.
|
||||||
|
|
||||||
<!-- TODO: improve example? -->
|
|
||||||
|
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
|
> from typing import Iterator
|
||||||
> import spacy
|
> import spacy
|
||||||
> from thinc.api import Model
|
|
||||||
>
|
>
|
||||||
> @spacy.registry.architectures("CustomNER.v1")
|
> @spacy.registry.schedules("waltzing.v1")
|
||||||
> def custom_ner(n0: int) -> Model:
|
> def waltzing() -> Iterator[float]:
|
||||||
> return Model("custom", forward, dims={"nO": nO})
|
> i = 0
|
||||||
|
> while True:
|
||||||
|
> yield i % 3 + 1
|
||||||
|
> i += 1
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Registry name | Description |
|
| Registry name | Description |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user