mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	remove labels from morphologizer constructor
This commit is contained in:
		
							parent
							
								
									d5a920325f
								
							
						
					
					
						commit
						73fc1ed963
					
				| 
						 | 
					@ -67,9 +67,6 @@ class Morphologizer(Tagger):
 | 
				
			||||||
        vocab: Vocab,
 | 
					        vocab: Vocab,
 | 
				
			||||||
        model: Model,
 | 
					        model: Model,
 | 
				
			||||||
        name: str = "morphologizer",
 | 
					        name: str = "morphologizer",
 | 
				
			||||||
        *,
 | 
					 | 
				
			||||||
        labels_morph: Optional[dict] = None,
 | 
					 | 
				
			||||||
        labels_pos: Optional[dict] = None,
 | 
					 | 
				
			||||||
    ):
 | 
					    ):
 | 
				
			||||||
        """Initialize a morphologizer.
 | 
					        """Initialize a morphologizer.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,8 +74,6 @@ class Morphologizer(Tagger):
 | 
				
			||||||
        model (thinc.api.Model): The Thinc Model powering the pipeline component.
 | 
					        model (thinc.api.Model): The Thinc Model powering the pipeline component.
 | 
				
			||||||
        name (str): The component instance name, used to add entries to the
 | 
					        name (str): The component instance name, used to add entries to the
 | 
				
			||||||
            losses during training.
 | 
					            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
 | 
					        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:
 | 
					        # store mappings from morph+POS labels to token-level annotations:
 | 
				
			||||||
        # 1) labels_morph stores a mapping from morph+POS->morph
 | 
					        # 1) labels_morph stores a mapping from morph+POS->morph
 | 
				
			||||||
        # 2) labels_pos stores a mapping from morph+POS->POS
 | 
					        # 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()))
 | 
					        self.cfg = dict(sorted(cfg.items()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -66,9 +66,6 @@ shortcut for this and instantiate the component using its string name and
 | 
				
			||||||
| `vocab`        | The shared vocabulary. ~~Vocab~~                                                                                     |
 | 
					| `vocab`        | The shared vocabulary. ~~Vocab~~                                                                                     |
 | 
				
			||||||
| `model`        | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. ~~Model[List[Doc], List[Floats2d]]~~ |
 | 
					| `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~~                  |
 | 
					| `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"}
 | 
					## Morphologizer.\_\_call\_\_ {#call tag="method"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user