MCPcopy Create free account
hub / github.com/pytorch/tutorials / forward

Method forward

beginner_source/nlp/advanced_tutorial.py:284–290  ·  view source on GitHub ↗
(self, sentence)

Source from the content-addressed store, hash-verified

282 return forward_score - gold_score
283
284 def forward(self, sentence): # dont confuse this with _forward_alg above.
285 # Get the emission scores from the BiLSTM
286 lstm_feats = self._get_lstm_features(sentence)
287
288 # Find the best path, given the features.
289 score, tag_seq = self._viterbi_decode(lstm_feats)
290 return score, tag_seq
291
292#####################################################################
293# Run training

Callers

nothing calls this directly

Calls 2

_get_lstm_featuresMethod · 0.95
_viterbi_decodeMethod · 0.95

Tested by

no test coverage detected