【发布时间】:2019-06-25 12:26:28
【问题描述】:
我正在 tensorflow hub 中查看 ELMo 模型,我不太清楚 tokens_length = [6, 5] 在流示例中的含义是什么: (https://tfhub.dev/google/elmo/2)
elmo = hub.Module("https://tfhub.dev/google/elmo/2", trainable=True)
tokens_input = [["the", "cat", "is", "on", "the", "mat"],
["dogs", "are", "in", "the", "fog", ""]]
tokens_length = [6, 5]
embeddings = elmo(
inputs={
"tokens": tokens_input,
"sequence_len": tokens_length
},
signature="tokens",
as_dict=True)["elmo"]
它不喜欢输入标记句子的最大长度,也不喜欢[每个句子的最大单词数,句子数],这让我感到困惑。 有人可以解释一下吗? 谢谢!
【问题讨论】:
标签: tensorflow nlp embedding elmo