-
Notifications
You must be signed in to change notification settings - Fork 1
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
Future of CRF layer #28
Comments
Looks like CRF is available in tf 2.0 https://www.tensorflow.org/addons/api_docs/python/tfa/text/crf |
Here's an example, but note that the CRF module is now in tfa.text.crf, not contrib: https://github.com/OpenNMT/OpenNMT-tf/blob/master/opennmt/models/sequence_tagger.py |
Ahh it is implemented for tf but not for tf.keras, though looks like it could be coming: tensorflow/addons#377 (review) |
This has been merged: tensorflow/addons#1999 |
Hello, when using CRF layer with BI-LSTM for an NER task, i get the following error :
I get that it's a problem in the loss function, but I don't know how to get past it. Could you please help if you have found a solution ? |
Hi @chaalic is this code you are running outside of the deep reference parser? |
Yes it's for another task of named entity recognition, but the model i'm using is the same : bilstm with CRF. |
Ah OK. If you post some more of your code here we may be able to spot something. |
The CRF causes some problems, namely:
keras_contribs.CRF
which:Replacing the CRF some other output would ameliorate these problems. Note that it is already possible to remove it right now by specifying
output="softmax"
rather than"crf"
when building the model withdeep_reference_parser.build_model()
. A softmax output will almost certainly perform worse than a CRF though.The text was updated successfully, but these errors were encountered: