diff --git a/spacy/_ml.py b/spacy/_ml.py index 09e810a98..31e0767c7 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -406,15 +406,11 @@ def Tok2Vec(width, embed_size, **kwargs): pretrained_vectors = kwargs.get("pretrained_vectors", None) cnn_maxout_pieces = kwargs.get("cnn_maxout_pieces", 3) subword_features = kwargs.get("subword_features", True) - char_embed = util.env_opt("char_embed", kwargs.get("char_embed", False)) + char_embed = kwargs.get("char_embed", False) conv_depth = kwargs.get("conv_depth", 4) - bilstm_depth = util.env_opt("bilstm_depth", kwargs.get("bilstm_depth", 0)) - self_attn_depth = util.env_opt("self_attn_depth", kwargs.get("self_attn_depth", 0)) - conv_window = util.env_opt("conv_window", kwargs.get("cnn_window", 1)) - kwargs.setdefault("bilstm_depth", bilstm_depth) - kwargs.setdefault("self_attn_depth", self_attn_depth) - kwargs.setdefault("char_embed", char_embed) - kwargs.setdefault("conv_window", conv_window) + bilstm_depth = kwargs.get("bilstm_depth", 0) + self_attn_depth = kwargs.get("self_attn_depth", 0) + conv_window = kwargs.get("conv_window", 1) if char_embed and self_attn_depth: return Tok2Vec_chars_selfattention(width, embed_size, **kwargs) elif char_embed and bilstm_depth: