-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Description
Hello
in this part of your code in bertcrf class (forward fn), you write it is for pass the first token but i don't understand how this hanpped (and the len of seq_logist and seq_lables doed not change it the same length with sub tokens , CLS and SEP )
"for seq_logits, seq_labels, seq_mask in zip(logits, labels, mask):
# Index logits and labels using prediction mask to pass only the
# first subtoken of each word to CRF.
seq_logits = seq_logits[seq_mask].unsqueeze(0)
seq_labels = seq_labels[seq_mask].unsqueeze(0)
loss -= self.crf(seq_logits, seq_labels,
reduction='token_mean')"
Metadata
Metadata
Assignees
Labels
No labels