我正在 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"]
它不喜欢输入标记句子的最大长度,也不喜欢 [每个句子的最大单词数,句子数],这让我感到困惑。有人可以解释一下吗?谢谢!