【发布时间】:2021-05-17 04:29:19
【问题描述】:
我正在尝试在 XLNet 中做类似的事情,但我在文档中找不到这部分,任何帮助都会很有价值,谢谢!
# we access the transformer model within our bert object using the bert attribute
# (eg bert.bert instead of bert)
embeddings = bert.bert(input_ids, attention_mask=mask)[1] # access pooled activations with [1]
(我尝试用 xlnet 代替 bert.bert)
【问题讨论】:
-
您能说明一下您使用的是哪个库吗?我假设它是
huggingface-transformers,但很可能是另一个 :) -
嗨!是的,添加 Dense 层是拥抱面部转换器和 Tensorflow,在此先感谢! :)
标签: python tensorflow nlp tf.keras transformer