Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

关于ASGCN-BERT中的aspect_double_idx #218

Description

@wkk-nlp

如果我用BERT预训练做ASGCN,aspect_double_idx修改成aspect_double_idx = torch.cat([left_len.unsqueeze(1), (left_len+aspect_len-1).unsqueeze(1)], dim=1)是正确的嘛,我按照上述修改会报错。
File "/root/autodl-tmp/ABSA-PyTorch-master/models/asgcn_bert.py", line 75, in mask
mask = torch.tensor(mask, dtype=torch.float).unsqueeze(2).to(self.opt.device)
ValueError: expected sequence of length 85 at dim 1 (got 90)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions