kazu.training.modelling

Functions

multi_label_forward(model, outputs, ...[, ...])

Classes

class kazu.training.modelling.BertForMultiLabelTokenClassification[source]

Bases: BertForTokenClassification

__init__(config)[source]

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

Parameters:

config (PretrainedConfig)

Return type:

None

forward(input_ids=None, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None, inputs_embeds=None, labels=None, output_attentions=None, output_hidden_states=None, return_dict=None)[source]
Parameters:
  • input_ids (Tensor | None)

  • attention_mask (Tensor | None)

  • token_type_ids (Tensor | None)

  • position_ids (Tensor | None)

  • head_mask (Tensor | None)

  • inputs_embeds (Tensor | None)

  • labels (Tensor | None)

  • output_attentions (bool | None)

  • output_hidden_states (bool | None)

  • return_dict (bool | None)

Returns:

Return type:

TokenClassifierOutput | Tuple[Tensor, …]

class kazu.training.modelling.DebertaForMultiLabelTokenClassification[source]

Bases: DebertaV2ForTokenClassification

__init__(config)[source]

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

Parameters:

config (PretrainedConfig)

Return type:

None

forward(input_ids=None, attention_mask=None, token_type_ids=None, position_ids=None, inputs_embeds=None, labels=None, output_attentions=None, output_hidden_states=None, return_dict=None)[source]
Parameters:
  • input_ids (Tensor | None)

  • attention_mask (Tensor | None)

  • token_type_ids (Tensor | None)

  • position_ids (Tensor | None)

  • inputs_embeds (Tensor | None)

  • labels (Tensor | None)

  • output_attentions (bool | None)

  • output_hidden_states (bool | None)

  • return_dict (bool | None)

Returns:

Return type:

Tuple | TokenClassifierOutput

class kazu.training.modelling.DistilBertForMultiLabelTokenClassification[source]

Bases: DistilBertForTokenClassification

__init__(config)[source]

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

Parameters:

config (PretrainedConfig)

Return type:

None

forward(input_ids=None, attention_mask=None, head_mask=None, inputs_embeds=None, labels=None, output_attentions=None, output_hidden_states=None, return_dict=None)[source]
Parameters:
  • input_ids (Tensor | None)

  • attention_mask (Tensor | None)

  • head_mask (Tensor | None)

  • inputs_embeds (Tensor | None)

  • labels (LongTensor | None)

  • output_attentions (bool | None)

  • output_hidden_states (bool | None)

  • return_dict (bool | None)

Returns:

Return type:

TokenClassifierOutput | Tuple[Tensor, …]

kazu.training.modelling.multi_label_forward(model, outputs, return_dict, device, ignore_index, labels=None)[source]
Parameters:
Return type:

TokenClassifierOutput | Tuple[Tensor, …]