def __init__(
        self,
        vocab: Vocab,
        model: Model,
        name: str = "trainable_lemmatizer",
        *,
        backoff: Optional[str] = "orth",
        min_tree_freq: int = 3,
        overwrite: bool = False,
        top_k: int = 1,
        scorer: Optional[Callable] = lemmatizer_score,
    ):
        """
        Construct an edit tree lemmatizer.

        backoff (Optional[str]): backoff to use when the predicted edit trees
            are not applicable. Must be an attribute of Token or None (leave the
            lemma unset).
        min_tree_freq (int): prune trees that are applied less than this
            frequency in the training data.
        overwrite (bool): overwrite existing lemma annotations.
        top_k (int): try to apply at most the k most probable edit trees.
        """
        self.vocab = vocab
        self.model = model
        self.name = name
        self.backoff = backoff
        self.min_tree_freq = min_tree_freq
        self.overwrite = overwrite
        self.top_k = top_k

        self.trees = EditTrees(self.vocab.strings)
        self.tree2label: Dict[int, int] = {}

        self.cfg: Dict[str, Any] = {"labels": []}
        self.scorer = scorer
        self.numpy_ops = NumpyOps()

        Construct an edit tree lemmatizer.

        backoff (Optional[str]): backoff to use when the predicted edit trees
            are not applicable. Must be an attribute of Token or None (leave the
            lemma unset).
        min_tree_freq (int): prune trees that are applied less than this
            frequency in the training data.
        overwrite (bool): overwrite existing lemma annotations.
        top_k (int): try to apply at most the k most probable edit trees.
        
spacy/pipeline/edit_tree_lemmatizer.py