question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to put Elmo as a Keras layer and integrate it into a Keras model?

See original GitHub issue

I used my own corpus to trained Elmo provided here. I wonder if there is a way to put Elmo as a Keras layer and integrate it into a Keras model. If yes, could you please provide an example just like usage_character.py? Thank you very much.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
nreimerscommented, Oct 23, 2018

I added some examples here: https://github.com/UKPLab/elmo-bilstm-cnn-crf https://github.com/UKPLab/elmo-bilstm-cnn-crf/blob/master/Keras_ELMo_Tutorial.ipynb

There I used ELMo to train a Keras network (for sentence classification and sequence tagging).

In my first experiments I had the ELMo layer as a trainable embedding layer. However, this produces computationally quite a large overhead, because the ELMo embeddings must be computed each time. Computing the embeddings once and fixing them gave a big performance boost (at training time) without reducing the performance.

1reaction
jacobzweigcommented, Nov 29, 2018

Hi - just a small note that I’ve updated the example in https://github.com/strongio/keras-elmo/blob/master/Elmo Keras.ipynb to allow trainable weights. Hope that helps 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elmo Embeddings in Keras with TensorFlow hub
With a few fixes, it's easy to integrate a Tensorflow hub model with Keras! ELMo embeddings, developed at Allen NLP, are one of...
Read more >
Using ELMo with Keras, how to correctly input the training set ...
Using this Elmo, the embedding is integrated as a layer following the input layer, so the input layer is actually a string.
Read more >
How to Use ELMo Word Vectors for Spam Classification
... a tutorial on how to use TensorFlow Hub to get the ELMo word vectors module into Keras. This an example of how...
Read more >
ELMo Embeddings in Keras - Sujay S Kumar
In this blog post, I will be demonstrating how to use ELMo Embeddings in Keras. Pre-trained ELMo Embeddings are freely available as a ......
Read more >
Word embeddings | Text - TensorFlow
You will train your own word embeddings using a simple Keras model for a sentiment classification task, and then visualize them in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found