Skip to content

Commit 39aabf5

Browse files
committed
Also rename to include_static_vectors in CharEmbed
1 parent 67652bc commit 39aabf5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

spacy/ml/models/tok2vec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def CharacterEmbed(
177177
rows: int,
178178
nM: int,
179179
nC: int,
180-
also_use_static_vectors: bool,
180+
include_static_vectors: bool,
181181
feature: Union[int, str] = "LOWER",
182182
) -> Model[List[Doc], List[Floats2d]]:
183183
"""Construct an embedded representation based on character embeddings, using
@@ -204,13 +204,13 @@ def CharacterEmbed(
204204
nC (int): The number of UTF-8 bytes to embed per word. Recommended values
205205
are between 3 and 8, although it may depend on the length of words in the
206206
language.
207-
also_use_static_vectors (bool): Whether to also use static word vectors.
207+
include_static_vectors (bool): Whether to also use static word vectors.
208208
Requires a vectors table to be loaded in the Doc objects' vocab.
209209
"""
210210
feature = intify_attr(feature)
211211
if feature is None:
212212
raise ValueError(Errors.E911(feat=feature))
213-
if also_use_static_vectors:
213+
if include_static_vectors:
214214
model = chain(
215215
concatenate(
216216
chain(_character_embed.CharacterEmbed(nM=nM, nC=nC), list2ragged()),

spacy/pipeline/morphologizer.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ width = 128
3232
rows = 7000
3333
nM = 64
3434
nC = 8
35-
also_use_static_vectors = false
35+
include_static_vectors = false
3636
3737
[model.tok2vec.encode]
3838
@architectures = "spacy.MaxoutWindowEncoder.v1"

spacy/tests/pipeline/test_tok2vec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def test_tok2vec_batch_sizes(batch_size, width, embed_size):
6363
[
6464
(8, MultiHashEmbed, {"rows": [100, 100], "attrs": ["SHAPE", "LOWER"], "include_static_vectors": False}, MaxoutWindowEncoder, {"window_size": 1, "maxout_pieces": 3, "depth": 2}),
6565
(8, MultiHashEmbed, {"rows": [100, 20], "attrs": ["ORTH", "PREFIX"], "include_static_vectors": False}, MishWindowEncoder, {"window_size": 1, "depth": 6}),
66-
(8, CharacterEmbed, {"rows": 100, "nM": 64, "nC": 8, "also_use_static_vectors": False}, MaxoutWindowEncoder, {"window_size": 1, "maxout_pieces": 3, "depth": 3}),
67-
(8, CharacterEmbed, {"rows": 100, "nM": 16, "nC": 2, "also_use_static_vectors": False}, MishWindowEncoder, {"window_size": 1, "depth": 3}),
66+
(8, CharacterEmbed, {"rows": 100, "nM": 64, "nC": 8, "include_static_vectors": False}, MaxoutWindowEncoder, {"window_size": 1, "maxout_pieces": 3, "depth": 3}),
67+
(8, CharacterEmbed, {"rows": 100, "nM": 16, "nC": 2, "include_static_vectors": False}, MishWindowEncoder, {"window_size": 1, "depth": 3}),
6868
],
6969
)
7070
# fmt: on

0 commit comments

Comments
 (0)