Imported from https://github.com/sadeepj/crfasrnn_keras