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

CRF for keras 2.0 #6226

Closed
wants to merge 11 commits into from
Closed

Conversation

linxihui
Copy link
Contributor

An Implementation of linear chain conditional random field (CRF), modified for keras 2.0 from previous PR #4646.

@fchollet
Copy link
Collaborator

fchollet commented Apr 12, 2017

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:

  • Avoid features that are too niche. All code/APIs in core Keras have a maintenance cost, so we try to only include those that are useful to many.
  • Give brand new code some time to mature through real-world usage, both in terms of UX/APIs and in terms of implementation.

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)
Copy link
Contributor

@nzw0301 nzw0301 Apr 15, 2017

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
Copy link
Contributor

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]
Copy link
Contributor

@nzw0301 nzw0301 Apr 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable input_length

@yoookoo
Copy link

yoookoo commented Apr 17, 2017

How can I use this CRF layer in image segmentation, can I set units to be an array?

@ahundt
Copy link
Contributor

ahundt commented Apr 17, 2017

https://github.com/farizrahman4u/keras-contrib also see CONTRIBUTING.md

@fchollet
Copy link
Collaborator

Closing since expecting it to go to keras-contrib. May get included in core Keras in the future.

@fchollet fchollet closed this Apr 17, 2017
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

Successfully merging this pull request may close these issues.

5 participants