import torch


def make_bow_vector(sentence, word_to_ix):
    """
Turn a sentence (list of words) into a vector using the dictionary (word_to_ix)
return data is a FloatTensor of shape 1 (batch size) by len(word_to_ix)"""
    vec = torch.zeros(len(word_to_ix))
    for word in sentence:
        vec[word_to_ix[word]] += 1
    return vec.view(1, -1)