Skip to content

Commit 3507e4a

Browse files
zxyezxye
authored andcommitted
add no-crf
1 parent 3388f6b commit 3507e4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _score_sentence(self, feats, tags):
108108
pad_start_tags = torch.cat([torch.LongTensor([self.tag_to_ix[START_TAG]]), tags])
109109
pad_stop_tags = torch.cat([tags, torch.LongTensor([self.tag_to_ix[STOP_TAG]])])
110110

111-
score = torch.sum(self.transitions[pad_stop_tags, pad_start_tags]) + torch.sum(feats.data[r, tags])
111+
score = torch.sum(self.transitions[pad_stop_tags, pad_start_tags]) + torch.sum(feats[r, tags])
112112

113113
return score
114114

0 commit comments

Comments
 (0)