(sentence, word_to_ix)
| 281 | |
| 282 | |
| 283 | def make_bow_vector(sentence, word_to_ix): |
| 284 | vec = torch.zeros(len(word_to_ix)) |
| 285 | for word in sentence: |
| 286 | vec[word_to_ix[word]] += 1 |
| 287 | return vec.view(1, -1) |
| 288 | |
| 289 | |
| 290 | def make_target(label, label_to_ix): |
no outgoing calls
no test coverage detected