Yuhan Liu
Yuhan Liu
me too, have you solve this problem?
您好,代码都在学校的电脑上,因为疫情的原因暂时连接不上,等我返校后再上传吧。另外的话这个脚本文件基本和Hugginface transformer的脚本文件一致的,您也可以参照这个自己写一个。
I met the same problem as yours, have you ever solved it?
因为我需要利用elmo得出的词向量拼接到我的LSTM得出的隐状态中,因此想要```e.sents2elmo(sents)```得出的向量长度统一,因此想要人为的padding,如果不这样做的话怎么才能使得出的向量长度统一呢?
我最后去源代码里看了看,发现他最后返回numpy的时候是按照实际长度剪切过的: ``` for w, c, lens, masks, texts in zip(test_w, test_c, test_lens, test_masks, test_text): output = self.model.forward(w, c, masks) for i, text in enumerate(texts): if self.config['encoder']['name'].lower() == 'lstm': data =...