这是使用EMLo获取嵌入的代码
import tensorflow_hub as hub
import tensorflow as tf
elmo = hub.Module("https://tfhub.dev/google/elmo/2")
x = ["Roasted ants are a popular snack in Columbia"]
embeddings = elmo(x, signature="default", as_dict=True)["elmo"] # To Extract ELMo features
embeddings.shape
我得到了这个类型错误,type error : pruned(text): expected argument #0(zero-based) to be a Tensor; got list (['Roasted ants are a popular snack in Columbia'])
目前没有回答
相关问题 更多 >
编程相关推荐