allanj / pytorch_neural_crf

Pytorch implementation of LSTM/BERT-CRF for named entity recognition
359 stars 62 forks source link

Can you tell me what is the forward_labeld and foward_unlabeld? #6

Closed zshy1205 closed 5 years ago

zshy1205 commented 5 years ago

Can you give some advice about read your code? why the loss use forward_labeld and foward_unlabeld?

mxc19912008 commented 5 years ago

This might be helpful: https://github.com/allanj/pytorch_lstmcrf/issues/4#issuecomment-526368279

zshy1205 commented 5 years ago

Thanks

allanj commented 5 years ago

Thanks @mxc19912008 . To briefly elaborate more about this: forward_labeled calculates the score (in log-space) corresponds to the gold path. forward_unlabeled calculate the sum of the scores (in log-space) that corresponds to all the possible paths.