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

Any example to use CRF on custom training #2052

Closed
pinedbean opened this issue Jul 28, 2020 · 4 comments
Closed

Any example to use CRF on custom training #2052

pinedbean opened this issue Jul 28, 2020 · 4 comments
Labels

Comments

@pinedbean
Copy link

I'm googling a lot of example of BiLSTM-CRF

but can't find an example one to do BiLSTM-CRF on tensorflow 2.2+

I also try to import
from tensorflow_addons.layers import CRF

but it can't find CRF

@bhack
Copy link
Contributor

bhack commented Jul 28, 2020

@bhack
Copy link
Contributor

bhack commented Jul 28, 2020

This could be also a duplicate of:
#337
#1769

@bhack bhack added the crf label Jul 28, 2020
@pinedbean
Copy link
Author

Yes, I'm looking on that one already

Here is what I try to implement

CRF

log_likelihood, self.transition_params = tfa.text.crf_log_likelihood(logits,
label_sequences,
text_lens,
transition_params=self.transition_params)

And decode as

viterbi_path, _ = tfa.text.viterbi_decode(logit, model.transition_params)

But the result seem incorrect (all possibility go from 'O' -> 'O' when decode (try to do NER)

I'm not sure that I implement it correct or not

@bhack
Copy link
Contributor

bhack commented Jul 28, 2020

There are already two tickets about CRF example/documentation request. Please post there.

@bhack bhack closed this as completed Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants