(
        self,
        vocab: Vocab,
        model: Model[List[Doc], FullTransformerBatch],
        set_extra_annotations: Callable = null_annotation_setter,
        *,
        name: str = "transformer",
        max_batch_items: int = 128 * 32,  # Max size of padded batch
    )
Initialize the transformer component.
Initialize the transformer component.
Initialize the transformer component .
def __init__(
        self,
        vocab: Vocab,
        model: Model[List[Doc], FullTransformerBatch],
        set_extra_annotations: Callable = null_annotation_setter,
        *,
        name: str = "transformer",
        max_batch_items: int = 128 * 32,  # Max size of padded batch
    ):
        """Initialize the transformer component."""
        self.name = name
        self.vocab = vocab
        self.model = model
        if not isinstance(self.model, Model):
            raise ValueError(f"Expected Thinc Model, got: {type(self.model)}")
        self.set_extra_annotations = set_extra_annotations
        self.cfg = {"max_batch_items": max_batch_items}
        self.listener_map: Dict[str, List[TransformerListener]] = {}
        install_extensions()
def __init__ ( self , vocab : Vocab , model : Model [ List [ Doc ] , FullTransformerBatch ] , set_extra_annotations : Callable = null_annotation_setter , * , name : str = "transformer" , max_batch_items : int = 128 * 32 , # Max size of padded batch ) : self . name = name self . vocab = vocab self . model = model if not isinstance ( self . model , Model ) : raise ValueError ( f"Expected Thinc Model, got: {type(self.model)}" ) self . set_extra_annotations = set_extra_annotations self . cfg = { "max_batch_items" : max_batch_items } self . listener_map : Dict [ str , List [ TransformerListener ] ] = { } install_extensions ( )