diff --git a/spacy/ml/_biluo.py b/spacy/ml/_biluo.py index 77a2a6a77..ab2bd9e10 100644 --- a/spacy/ml/_biluo.py +++ b/spacy/ml/_biluo.py @@ -80,13 +80,13 @@ def _get_transition_table( B_start, B_end = (0, n_labels) I_start, I_end = (B_end, B_end + n_labels) L_start, L_end = (I_end, I_end + n_labels) - U_start, U_end = (L_end, L_end + n_labels) # noqa: F841 + U_start, U_end = (L_end, L_end + n_labels) # Using ranges allows us to set specific cells, which is necessary to express # that only actions of the same label are valid continuations. B_range = numpy.arange(B_start, B_end) I_range = numpy.arange(I_start, I_end) L_range = numpy.arange(L_start, L_end) - O_action = U_end # noqa: F841 + O_action = U_end # If this is the last token and the previous action was B or I, only L # of that label is valid table[1, B_range, L_range] = 1 diff --git a/spacy/ml/tb_framework.py b/spacy/ml/tb_framework.py index 69b40cbcf..f7dad565e 100644 --- a/spacy/ml/tb_framework.py +++ b/spacy/ml/tb_framework.py @@ -38,7 +38,7 @@ def forward(model, X, is_train): def init(model, X=None, Y=None): - tok2vec = model.get_ref("tok2vec").initialize(X=X) # noqa: F841 + tok2vec = model.get_ref("tok2vec").initialize(X=X) lower = model.get_ref("lower").initialize() if model.attrs["has_upper"]: statevecs = model.ops.alloc2f(2, lower.get_dim("nO")) @@ -46,7 +46,7 @@ def init(model, X=None, Y=None): def resize_output(model, new_nO): - tok2vec = model.get_ref("tok2vec") # noqa: F841 + tok2vec = model.get_ref("tok2vec") lower = model.get_ref("lower") upper = model.get_ref("upper") if not model.attrs["has_upper"]: diff --git a/spacy/tests/serialize/test_serialize_config.py b/spacy/tests/serialize/test_serialize_config.py index cfb9d7381..870a980f2 100644 --- a/spacy/tests/serialize/test_serialize_config.py +++ b/spacy/tests/serialize/test_serialize_config.py @@ -112,7 +112,7 @@ def test_serialize_custom_nlp(): nlp.to_disk(d) nlp2 = spacy.load(d) model = nlp2.get_pipe("parser").model - tok2vec = model.get_ref("tok2vec") # noqa: F841 + tok2vec = model.get_ref("tok2vec") upper = model.get_ref("upper") # check that we have the correct settings, not the default ones @@ -132,7 +132,7 @@ def test_serialize_parser(): nlp.to_disk(d) nlp2 = spacy.load(d) model = nlp2.get_pipe("parser").model - tok2vec = model.get_ref("tok2vec") # noqa: F841 + tok2vec = model.get_ref("tok2vec") upper = model.get_ref("upper") # check that we have the correct settings, not the default ones