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

Add Pure Keras 3 CRF Layer with Native Loss and Viterbi Decoding for Sequence Labeling #2122

Open
gcuder opened this issue Mar 2, 2025 · 0 comments
Assignees
Labels
type:feature New feature or request

Comments

@gcuder
Copy link

gcuder commented Mar 2, 2025

Is your feature request related to a problem? Please describe.
Currently, Keras-hub lacks a pure Keras 3 implementation of a CRF layer. This forces users to rely on external libraries like TensorFlow Addons, which can introduce dependency and compatibility issues as TFA is already deprecated.

Describe the solution you'd like
I'd like to implement a native CRF layer in Keras-hub that:

  • Computes CRF log-likelihood loss during training.
  • Applies Viterbi decoding during inference.
  • Integrates seamlessly with Keras 3’s API.
    Include clear documentation and usage examples.

Describe alternatives you've considered
Using TensorFlow Addons for CRF functionality was considered, but it adds deprecated dependencies that might cause conflicts.

Additional context

https://www.tensorflow.org/addons/api_docs/python/tfa/layers/CRF

@dhantule dhantule added the type:feature New feature or request label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants