Remove references to spacy.TransitionBasedParser.{v1,v2}

Since they will not be offered starting with spaCy v4.
This commit is contained in:
Daniël de Kok 2022-06-24 12:26:08 +02:00
parent 8fceabd563
commit f4d0e85e1b
5 changed files with 7 additions and 24 deletions

View File

@ -64,7 +64,7 @@ steps:
displayName: "Run GPU tests" displayName: "Run GPU tests"
condition: eq(${{ parameters.gpu }}, true) condition: eq(${{ parameters.gpu }}, true)
# Disabled in parser refactor branch, requires spacy.TransitionBasedParser.v2. # Re-enable when we have models trained for spacy.TransitionBasedParser.v3.
#- script: | #- script: |
# python -m spacy download ca_core_news_sm # python -m spacy download ca_core_news_sm
# python -m spacy download ca_core_news_md # python -m spacy download ca_core_news_md
@ -94,14 +94,14 @@ steps:
displayName: 'Test train CLI' displayName: 'Test train CLI'
condition: eq(variables['python_version'], '3.8') condition: eq(variables['python_version'], '3.8')
# Disabled in parser refactor branch, requires spacy.TransitionBasedParser.v2. # Re-enable when we have models trained for spacy.TransitionBasedParser.v3.
# - script: | # - script: |
# python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_sm'}; config.to_disk('ner_source_sm.cfg')" # python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_sm'}; config.to_disk('ner_source_sm.cfg')"
# PYTHONWARNINGS="error,ignore::DeprecationWarning" python -m spacy assemble ner_source_sm.cfg output_dir # PYTHONWARNINGS="error,ignore::DeprecationWarning" python -m spacy assemble ner_source_sm.cfg output_dir
# displayName: 'Test assemble CLI' # displayName: 'Test assemble CLI'
# condition: eq(variables['python_version'], '3.8') # condition: eq(variables['python_version'], '3.8')
# Disabled in parser refactor branch, requires spacy.TransitionBasedParser.v2. # Re-enable when we have models trained for spacy.TransitionBasedParser.v3.
# - script: | # - script: |
# python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_md'}; config.to_disk('ner_source_md.cfg')" # python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_md'}; config.to_disk('ner_source_md.cfg')"
# python -m spacy assemble ner_source_md.cfg output_dir 2>&1 | grep -q W113 # python -m spacy assemble ner_source_md.cfg output_dir 2>&1 | grep -q W113

View File

@ -459,10 +459,6 @@ def test_overfitting_IO(pipe_name):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"parser_config", "parser_config",
[ [
# TransitionBasedParser V1, FIXME: re-enable
# ({"@architectures": "spacy.TransitionBasedParser.v1", "tok2vec": DEFAULT_TOK2VEC_MODEL, "state_type": "parser", "extra_state_tokens": False, "hidden_width": 64, "maxout_pieces": 2, "use_upper": True}),
# TransitionBasedParser V2, FIXME: re-enable
# ({"@architectures": "spacy.TransitionBasedParser.v2", "tok2vec": DEFAULT_TOK2VEC_MODEL, "state_type": "parser", "extra_state_tokens": False, "hidden_width": 64, "maxout_pieces": 2, "use_upper": True}),
({"@architectures": "spacy.TransitionBasedParser.v3", "tok2vec": DEFAULT_TOK2VEC_MODEL, "state_type": "parser", "extra_state_tokens": False, "hidden_width": 64, "maxout_pieces": 2}), ({"@architectures": "spacy.TransitionBasedParser.v3", "tok2vec": DEFAULT_TOK2VEC_MODEL, "state_type": "parser", "extra_state_tokens": False, "hidden_width": 64, "maxout_pieces": 2}),
], ],
) )

View File

@ -602,13 +602,6 @@ consists of either two or three subnetworks:
| `nO` | The number of actions the model will predict between. Usually inferred from data at the beginning of training, or loaded from disk. ~~int~~ | | `nO` | The number of actions the model will predict between. Usually inferred from data at the beginning of training, or loaded from disk. ~~int~~ |
| **CREATES** | The model using the architecture. ~~Model[List[Docs], List[List[Floats2d]]]~~ | | **CREATES** | The model using the architecture. ~~Model[List[Docs], List[List[Floats2d]]]~~ |
<Accordion title="spacy.TransitionBasedParser.v1 definition" spaced>
[TransitionBasedParser.v1](/api/legacy#TransitionBasedParser_v1) had the exact
same signature, but the `use_upper` argument was `True` by default.
</Accordion>
## Tagging architectures {#tagger source="spacy/ml/models/tagger.py"} ## Tagging architectures {#tagger source="spacy/ml/models/tagger.py"}
### spacy.Tagger.v2 {#Tagger} ### spacy.Tagger.v2 {#Tagger}

View File

@ -359,7 +359,7 @@ Module spacy.language
File /path/to/spacy/language.py (line 64) File /path/to/spacy/language.py (line 64)
[components.ner.model] [components.ner.model]
Registry @architectures Registry @architectures
Name spacy.TransitionBasedParser.v1 Name spacy.TransitionBasedParser.v3
Module spacy.ml.models.parser Module spacy.ml.models.parser
File /path/to/spacy/ml/models/parser.py (line 11) File /path/to/spacy/ml/models/parser.py (line 11)
[components.ner.model.tok2vec] [components.ner.model.tok2vec]
@ -369,7 +369,7 @@ Module spacy.ml.models.tok2vec
File /path/to/spacy/ml/models/tok2vec.py (line 16) File /path/to/spacy/ml/models/tok2vec.py (line 16)
[components.parser.model] [components.parser.model]
Registry @architectures Registry @architectures
Name spacy.TransitionBasedParser.v1 Name spacy.TransitionBasedParser.v3
Module spacy.ml.models.parser Module spacy.ml.models.parser
File /path/to/spacy/ml/models/parser.py (line 11) File /path/to/spacy/ml/models/parser.py (line 11)
[components.parser.model.tok2vec] [components.parser.model.tok2vec]
@ -695,7 +695,7 @@ scorer = {"@scorers":"spacy.ner_scorer.v1"}
update_with_oracle_cut_size = 100 update_with_oracle_cut_size = 100
[components.ner.model] [components.ner.model]
@architectures = "spacy.TransitionBasedParser.v2" @architectures = "spacy.TransitionBasedParser.v3"
state_type = "ner" state_type = "ner"
extra_state_tokens = false extra_state_tokens = false
- hidden_width = 64 - hidden_width = 64
@ -718,7 +718,7 @@ scorer = {"@scorers":"spacy.parser_scorer.v1"}
update_with_oracle_cut_size = 100 update_with_oracle_cut_size = 100
[components.parser.model] [components.parser.model]
@architectures = "spacy.TransitionBasedParser.v2" @architectures = "spacy.TransitionBasedParser.v3"
state_type = "parser" state_type = "parser"
extra_state_tokens = false extra_state_tokens = false
hidden_width = 128 hidden_width = 128

View File

@ -222,12 +222,6 @@ the others, but may not be as accurate, especially if texts are short.
| `nO` | Output dimension, determined by the number of different labels. If not set, the [`TextCategorizer`](/api/textcategorizer) component will set it when `initialize` is called. ~~Optional[int]~~ | | `nO` | Output dimension, determined by the number of different labels. If not set, the [`TextCategorizer`](/api/textcategorizer) component will set it when `initialize` is called. ~~Optional[int]~~ |
| **CREATES** | The model using the architecture. ~~Model[List[Doc], Floats2d]~~ | | **CREATES** | The model using the architecture. ~~Model[List[Doc], Floats2d]~~ |
### spacy.TransitionBasedParser.v1 {#TransitionBasedParser_v1}
Identical to
[`spacy.TransitionBasedParser.v2`](/api/architectures#TransitionBasedParser)
except the `use_upper` was set to `True` by default.
## Layers {#layers} ## Layers {#layers}
These functions are available from `@spacy.registry.layers`. These functions are available from `@spacy.registry.layers`.