Add prefix to batchers

This commit is contained in:
Ines Montani 2020-09-03 17:30:41 +02:00
parent 804f120361
commit c063e55eb7
8 changed files with 14 additions and 14 deletions

View File

@ -36,7 +36,7 @@ max_length = 0
limit = 0
[training.batcher]
@batchers = "batch_by_words.v1"
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2

View File

@ -35,7 +35,7 @@ max_length = 0
limit = 0
[training.batcher]
@batchers = "batch_by_words.v1"
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2

View File

@ -204,13 +204,13 @@ max_length = 0
{% if use_transformer %}
[training.batcher]
@batchers = "batch_by_padded.v1"
@batchers = "spacy.batch_by_padded.v1"
discard_oversize = true
size = 2000
buffer = 256
{%- else %}
[training.batcher]
@batchers = "batch_by_words.v1"
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2

View File

@ -69,7 +69,7 @@ max_length = 2000
limit = 0
[training.batcher]
@batchers = "batch_by_words.v1"
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2

View File

@ -11,7 +11,7 @@ ItemT = TypeVar("ItemT")
BatcherT = Callable[[Iterable[ItemT]], Iterable[List[ItemT]]]
@registry.batchers("batch_by_padded.v1")
@registry.batchers("spacy.batch_by_padded.v1")
def configure_minibatch_by_padded_size(
*,
size: Sizing,
@ -46,7 +46,7 @@ def configure_minibatch_by_padded_size(
)
@registry.batchers("batch_by_words.v1")
@registry.batchers("spacy.batch_by_words.v1")
def configure_minibatch_by_words(
*,
size: Sizing,
@ -70,7 +70,7 @@ def configure_minibatch_by_words(
)
@registry.batchers("batch_by_sequence.v1")
@registry.batchers("spacy.batch_by_sequence.v1")
def configure_minibatch(
size: Sizing, get_length: Optional[Callable[[ItemT], int]] = None
) -> BatcherT:

View File

@ -28,7 +28,7 @@ path = ${paths.train}
path = ${paths.dev}
[training.batcher]
@batchers = "batch_by_words.v1"
@batchers = "spacy.batch_by_words.v1"
size = 666
[nlp]

View File

@ -271,7 +271,7 @@ training -> dropout field required
training -> optimizer field required
training -> optimize extra fields not permitted
{'vectors': 'en_vectors_web_lg', 'seed': 0, 'accumulate_gradient': 1, 'init_tok2vec': None, 'raw_text': None, 'patience': 1600, 'max_epochs': 0, 'max_steps': 20000, 'eval_frequency': 200, 'frozen_components': [], 'optimize': None, 'batcher': {'@batchers': 'batch_by_words.v1', 'discard_oversize': False, 'tolerance': 0.2, 'get_length': None, 'size': {'@schedules': 'compounding.v1', 'start': 100, 'stop': 1000, 'compound': 1.001, 't': 0.0}}, 'dev_corpus': {'@readers': 'spacy.Corpus.v1', 'path': '', 'max_length': 0, 'gold_preproc': False, 'limit': 0}, 'score_weights': {'tag_acc': 0.5, 'dep_uas': 0.25, 'dep_las': 0.25, 'sents_f': 0.0}, 'train_corpus': {'@readers': 'spacy.Corpus.v1', 'path': '', 'max_length': 0, 'gold_preproc': False, 'limit': 0}}
{'vectors': 'en_vectors_web_lg', 'seed': 0, 'accumulate_gradient': 1, 'init_tok2vec': None, 'raw_text': None, 'patience': 1600, 'max_epochs': 0, 'max_steps': 20000, 'eval_frequency': 200, 'frozen_components': [], 'optimize': None, 'batcher': {'@batchers': 'spacy.batch_by_words.v1', 'discard_oversize': False, 'tolerance': 0.2, 'get_length': None, 'size': {'@schedules': 'compounding.v1', 'start': 100, 'stop': 1000, 'compound': 1.001, 't': 0.0}}, 'dev_corpus': {'@readers': 'spacy.Corpus.v1', 'path': '', 'max_length': 0, 'gold_preproc': False, 'limit': 0}, 'score_weights': {'tag_acc': 0.5, 'dep_uas': 0.25, 'dep_las': 0.25, 'sents_f': 0.0}, 'train_corpus': {'@readers': 'spacy.Corpus.v1', 'path': '', 'max_length': 0, 'gold_preproc': False, 'limit': 0}}
If your config contains missing values, you can run the 'init fill-config'
command to fill in all the defaults, if possible:
@ -361,7 +361,7 @@ Module spacy.gold.loggers
File /path/to/spacy/gold/loggers.py (line 8)
[training.batcher]
Registry @batchers
Name batch_by_words.v1
Name spacy.batch_by_words.v1
Module spacy.gold.batchers
File /path/to/spacy/gold/batchers.py (line 49)
[training.batcher.size]

View File

@ -478,7 +478,7 @@ themselves, or be discarded if `discard_oversize` is set to `True`. The argument
>
> ```ini
> [training.batcher]
> @batchers = "batch_by_words.v1"
> @batchers = "spacy.batch_by_words.v1"
> size = 100
> tolerance = 0.2
> discard_oversize = false
@ -499,7 +499,7 @@ themselves, or be discarded if `discard_oversize` is set to `True`. The argument
>
> ```ini
> [training.batcher]
> @batchers = "batch_by_sequence.v1"
> @batchers = "spacy.batch_by_sequence.v1"
> size = 32
> get_length = null
> ```
@ -517,7 +517,7 @@ Create a batcher that creates batches of the specified size.
>
> ```ini
> [training.batcher]
> @batchers = "batch_by_padded.v1"
> @batchers = "spacy.batch_by_padded.v1"
> size = 100
> buffer = 256
> discard_oversize = false