(context, word_to_ix)
| 345 | |
| 346 | |
| 347 | def make_context_vector(context, word_to_ix): |
| 348 | idxs = [word_to_ix[w] for w in context] |
| 349 | return torch.tensor(idxs, dtype=torch.long) |
| 350 | |
| 351 | |
| 352 | make_context_vector(data[0][0], word_to_ix) # example |
no outgoing calls
no test coverage detected