Closed tokestermw closed 4 years ago
Ah, there is an output_key
option 😅
elmo = hub.KerasLayer("https://tfhub.dev/google/elmo/3",
trainable=True,
signature="tokens",
output_key="elmo")
@tokestermw according to the official page: https://www.tensorflow.org/hub/api_docs/python/hub/KerasLayer I didn't see any information about the initial params you used (signature, output_key ..). May you tell me where did you find out this use case?
@Zachary4biz In the source code for KerasLayer
: https://github.com/tensorflow/hub/blob/master/tensorflow_hub/keras_layer.py#L117
Hi, is it possible to load the ELMo module using tensorflow hub and return the full ELMo embeddings? I would like to extract the
"elmo"
embeddings which returns contextual embeddings for each token. I need to makeas_dict=True
, butKerasLayer
doesn't seem to allow it. I am also trying to avoid usingLambda
layers because of issues with serialization.Code to reproduce
Model summary
Package versions
trainable=True
doesn't work.Separately,
trainable=True
doesn't seem to do much. I would expect 4 weights to be trainable, but none of them are.Thanks