# biome.text.modules.heads.classification.doc_classification Module

# DocumentClassification Class


class DocumentClassification (
    backbone: ModelBackbone,
    labels: List[str],
    tokens_pooler: Union[Seq2VecEncoderConfiguration, NoneType] = None,
    sentences_encoder: Union[Seq2SeqEncoderConfiguration, NoneType] = None,
    sentences_pooler: Seq2VecEncoderConfiguration = None,
    feedforward: Union[FeedForwardConfiguration, NoneType] = None,
    multilabel: bool = False,
)

Task head for document text classification. It's quite similar to text classification but including the doc2vec transformation layers

Initializes internal Module state, shared by both nn.Module and ScriptModule.

# Ancestors

  • ClassificationHead
  • TaskHead
  • torch.nn.modules.module.Module
  • allennlp.common.registrable.Registrable
  • allennlp.common.from_params.FromParams

# Subclasses

# explain_prediction Method


def explain_prediction (
  self,
  prediction: Dict[str, ],
  instance: allennlp.data.instance.Instance,
  n_steps: int,
)  -> Dict[str, Any]

Here, we must apply transformations for manage ListFields tensors shapes

# Inherited members

# DocumentClassificationConfiguration Class


class DocumentClassificationConfiguration (*args, **kwds)

Lazy initialization for document classification head components

# Ancestors

# Inherited members

Maintained by