-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
CRF for keras 2.0 #6226
CRF for keras 2.0 #6226
Conversation
This is a very large change adding a brand new feature. Typically the process for such a change would be to first ship it in Keras contrib and have users try it out for a couple of months. After this trial period, if a sufficient large group of users want it, include it as part of core Keras. This is designed to:
|
x = [[w[0].lower() for w in s] for s in data] | ||
y = [[w[1] for w in s] for s in data] | ||
x = pad_sequences([[word2idx.get(w[0].lower(), 1) for w in s] for s in data], maxlen=maxlen) | ||
y = pad_sequences([[class_labels.index(w[1])for w in s] for s in data], maxlen=maxlen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space after (w[1])
@@ -0,0 +1,540 @@ | |||
import keras |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused statement
self.built = True | ||
|
||
def call(self, X, mask=None): | ||
input_length = K.int_shape(X)[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused variable input_length
How can I use this CRF layer in image segmentation, can I set units to be an array? |
https://github.com/farizrahman4u/keras-contrib also see CONTRIBUTING.md |
Closing since expecting it to go to |
An Implementation of linear chain conditional random field (CRF), modified for keras 2.0 from previous PR #4646.