ll0ruc / MOGANED

An unofficial code reproduction in the field of event extraction of EMNLP-19 paper "Event Detection with Multi-Order Graph Convolution and Aggregated Attention"
23 stars 9 forks source link

麻烦问下这里是什么意思,谢谢! #2

Open alwayslikethat opened 2 years ago

alwayslikethat commented 2 years ago
    for i in range(BATCH_SIZE):
        s_len = seqlen_1d[i]
        mask[i, 0:s_len] = 1
    mask = torch.FloatTensor(mask).to(self.device)
ll0ruc commented 2 years ago

@alwayslikethat generate sentence mask, get its final feature representation according to the actual length of sentence refer to line 60 in model.py xx_m = torch.mul(xx, mask.unsqueeze(2)