From 73fc1ed963121ce48c78e576b3123bf6e49455a8 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Wed, 11 Nov 2020 21:48:50 +0100 Subject: [PATCH] remove labels from morphologizer constructor --- spacy/pipeline/morphologizer.pyx | 7 +------ website/docs/api/morphologizer.md | 3 --- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/spacy/pipeline/morphologizer.pyx b/spacy/pipeline/morphologizer.pyx index 305f8f5df..66e0787ef 100644 --- a/spacy/pipeline/morphologizer.pyx +++ b/spacy/pipeline/morphologizer.pyx @@ -67,9 +67,6 @@ class Morphologizer(Tagger): vocab: Vocab, model: Model, name: str = "morphologizer", - *, - labels_morph: Optional[dict] = None, - labels_pos: Optional[dict] = None, ): """Initialize a morphologizer. @@ -77,8 +74,6 @@ class Morphologizer(Tagger): model (thinc.api.Model): The Thinc Model powering the pipeline component. name (str): The component instance name, used to add entries to the losses during training. - labels_morph (dict): Mapping of morph + POS tags to morph labels. - labels_pos (dict): Mapping of morph + POS tags to POS tags. DOCS: https://nightly.spacy.io/api/morphologizer#init """ @@ -90,7 +85,7 @@ class Morphologizer(Tagger): # store mappings from morph+POS labels to token-level annotations: # 1) labels_morph stores a mapping from morph+POS->morph # 2) labels_pos stores a mapping from morph+POS->POS - cfg = {"labels_morph": labels_morph or {}, "labels_pos": labels_pos or {}} + cfg = {"labels_morph": {}, "labels_pos": {}} self.cfg = dict(sorted(cfg.items())) @property diff --git a/website/docs/api/morphologizer.md b/website/docs/api/morphologizer.md index d32514fb0..fed86ff5d 100644 --- a/website/docs/api/morphologizer.md +++ b/website/docs/api/morphologizer.md @@ -66,9 +66,6 @@ shortcut for this and instantiate the component using its string name and | `vocab` | The shared vocabulary. ~~Vocab~~ | | `model` | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. ~~Model[List[Doc], List[Floats2d]]~~ | | `name` | String name of the component instance. Used to add entries to the `losses` during training. ~~str~~ | -| _keyword-only_ | | -| `labels_morph` | Mapping of morph + POS tags to morph labels. ~~Dict[str, str]~~ | -| `labels_pos` | Mapping of morph + POS tags to POS tags. ~~Dict[str, str]~~ | ## Morphologizer.\_\_call\_\_ {#call tag="method"}