(
        self,
        get_examples: Callable[[], Iterable[Example]],
        *,
        nlp: Optional[Language] = None,
    )
Initialize the pipe for training, using data examples if available.

        get_examples (Callable[[], Iterable[Example]]): Optional function that
            returns gold-standard Example objects.
        nlp (Language): The current nlp object.

        DOCS: https://spacy.io/api/transformer#initialize
Initialize the pipe for training, using data examples if available.
Initialize the pipe for training using data examples if available .
def initialize(
        self,
        get_examples: Callable[[], Iterable[Example]],
        *,
        nlp: Optional[Language] = None,
    ):
        """Initialize the pipe for training, using data examples if available.

        get_examples (Callable[[], Iterable[Example]]): Optional function that
            returns gold-standard Example objects.
        nlp (Language): The current nlp object.

        DOCS: https://spacy.io/api/transformer#initialize
        """
        validate_get_examples(get_examples, "Transformer.initialize")
        docs = [Doc(Vocab(), words=["hello"])]
        self.model.initialize(X=docs)
        if nlp is not None:
            for i, (name1, proc1) in enumerate(nlp.pipeline):
                if proc1 is self:
                    for name2, proc2 in nlp.pipeline[i:]:
                        self.find_listeners(proc2)
                    break
def initialize ( self , get_examples : Callable [ [ ] , Iterable [ Example ] ] , * , nlp : Optional [ Language ] = None , ) : validate_get_examples ( get_examples , "Transformer.initialize" ) docs = [ Doc ( Vocab ( ) , words = [ "hello" ] ) ] self . model . initialize ( X = docs ) if nlp is not None : for i , ( name1 , proc1 ) in enumerate ( nlp . pipeline ) : if proc1 is self : for name2 , proc2 in nlp . pipeline [ i : ] : self . find_listeners ( proc2 ) break