LM-LSTM-CRF
LM-LSTM-CRF copied to clipboard
About the score given a sequence and a target
Dear Author,
Thank you for sharing the code. I have a question about the forward() in CRFLoss_vb() in crf.py, it calculates the score of the golden state by:
tg_energy = torch.gather(scores.view(seq_len, bat_size, -1), 2, target).view(seq_len, bat_size)
tg_energy = tg_energy.masked_select(mask).sum()
However, it seems that each tag of the target sequence is handled separately and I don't really see the transitions like tag1->tag2->tag3->... Can you explain a little bit?