Skip to content

edsnlp.pipes.trainable.embeddings.doc_pooler.factory

create_component = registry.factory.register('eds.doc_pooler', assigns=[], deprecated=[])(DocPooler) module-attribute [source]

Pools word embeddings over the entire document to produce a single embedding per doc.

Parameters

PARAMETER DESCRIPTION
nlp

The pipeline object

TYPE: Optional[Pipeline] DEFAULT: None

name

Name of the component

TYPE: str DEFAULT: 'document_pooler'

embedding

The word embedding component

TYPE: WordEmbeddingComponent

pooling_mode

How word embeddings are aggregated into a single embedding per document.

TYPE: Literal['max', 'sum', 'mean', 'cls', 'attention'] DEFAULT: mean

hidden_size

The size of the hidden layer. If None, no projection is done.

TYPE: Optional[int]