fix MultiHashEmbed example in documentation

This commit is contained in:
svlandeg 2020-10-09 14:11:06 +02:00
parent 4771a10503
commit 853edace37
2 changed files with 4 additions and 6 deletions

View File

@ -110,7 +110,7 @@ def MultiHashEmbed(
The features used can be configured with the 'attrs' argument. The suggested The features used can be configured with the 'attrs' argument. The suggested
attributes are NORM, PREFIX, SUFFIX and SHAPE. This lets the model take into attributes are NORM, PREFIX, SUFFIX and SHAPE. This lets the model take into
account some subword information, without construction a fully character-based account some subword information, without constructing a fully character-based
representation. If pretrained vectors are available, they can be included in representation. If pretrained vectors are available, they can be included in
the representation as well, with the vectors table will be kept static the representation as well, with the vectors table will be kept static
(i.e. it's not updated). (i.e. it's not updated).

View File

@ -516,16 +516,14 @@ Many neural network models are able to use word vector tables as additional
features, which sometimes results in significant improvements in accuracy. features, which sometimes results in significant improvements in accuracy.
spaCy's built-in embedding layer, spaCy's built-in embedding layer,
[MultiHashEmbed](/api/architectures#MultiHashEmbed), can be configured to use [MultiHashEmbed](/api/architectures#MultiHashEmbed), can be configured to use
word vector tables using the `also_use_static_vectors` flag. This setting is word vector tables using the `include_static_vectors` flag.
also available on the [MultiHashEmbedCNN](/api/architectures#MultiHashEmbedCNN)
layer, which builds the default token-to-vector encoding architecture.
```ini ```ini
[tagger.model.tok2vec.embed] [tagger.model.tok2vec.embed]
@architectures = "spacy.MultiHashEmbed.v1" @architectures = "spacy.MultiHashEmbed.v1"
width = 128 width = 128
rows = 7000 attrs = ["NORM", "PREFIX", "SUFFIX", "SHAPE"]
also_embed_subwords = true rows = [7000, 3500, 3500, 3500]
also_use_static_vectors = true also_use_static_vectors = true
``` ```