Skip to content

Commit e560855

Browse files
authored
Update model.py
1 parent 0a703c3 commit e560855

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neural_ner/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import logging
99

1010
from crf import CRF_Loss
11-
from model_utils import init_lstm_wt, init_linear_wt, get_word_embd
11+
from model_utils import init_lstm_wt, init_linear_wt, get_word_embd, get_mask
1212

1313
logging.basicConfig(level=logging.INFO)
1414

@@ -158,6 +158,6 @@ def get_loss(self, logits, y, s_lens):
158158
return loss
159159

160160
def predict(self, emissions, lengths):
161-
161+
mask = get_mask(lengths, self.config)
162162
best_scores, pred = self.crf.viterbi_decode(emissions, mask)
163163
return pred

0 commit comments

Comments
 (0)