Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I wonder whether this softLabelCRF can be used on NLP task? NER for example? #2

Open
lkqnaruto opened this issue Dec 3, 2021 · 1 comment

Comments

@lkqnaruto
Copy link

Hi

Thank you for the great work, and it is very attractive. I wonder whether this softLabelCRF can be used on NLP task? NER for example? If so, how should I modify the code, any suggestions?

Thank you in advance!

@liujch1998
Copy link
Owner

Hello! The SoftLabelCRF algorithm is useful when your sequence labeling task may require multiple ground truth labels on the same token/span.

If this is the case for your NER task, you can try using a learnable matrix as your transition matrix. (We use a model to predict each entry of this matrix, but for NER since the labels are pre-defined you can use something simpler.) You may also enforce the value of some entries by rules (e.g. O->I should have zero transition probability, or equivalently, negative infinity transition potential).

You may refer to our paper for a more intuitive understanding of the algorithm. The code is a vectorized implementation so it may be hard to read.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants