allanj / ner_incomplete_annotation

125 stars 33 forks source link

[Question] NNCRF not using margions in forward #11

Closed yangyaofei closed 1 year ago

yangyaofei commented 1 year ago

Hi, I'm reading your code and paper. There is a problem I can't understand in following code:

https://github.com/allanj/ner_incomplete_annotation/blob/3d583353533990804c6b4451e0468cf5c552e68c/model/neuralcrf.py#L50

As I understand, the soft probabilities are store in the marginals, and update it after several loop, but can't find where to use it in training process, and the crf model try to use it , but in NNCRF forward function it not be put in to crf.

Is there something I missed?

glad to get a reply, thank you .

allanj commented 1 year ago

Sorry, I did not implement the soft approach in the PyTorch version.

In the DyNet version, it is here:

  1. https://github.com/allanj/ner_incomplete_annotation/blob/aa20c015b3f373ac4a1893e629ac8f2dd137faab/our_approach.py#L123
  2. https://github.com/allanj/ner_incomplete_annotation/blob/aa20c015b3f373ac4a1893e629ac8f2dd137faab/soft_lstmcrf.py#L133-L138
yangyaofei commented 1 year ago

Thank you to reply, I see the issue and commit, I thought it was finished.

I will looking that, thanks.