def get_reduced_word_representation(x, words):
    """
    Takes a sparse word vector and a set of words to keep,
    and returns the reduced vector with only certain dimensions kept.
    :param x: Sparse word vector
    :param words: Dimensions to keep
    :return: Sparse word vector with reduced dimensionality
    """
    w2w_red = {}
    for w, word in enumerate(words):
        w2w_red[word] = w

    x_red = []
    for i in x:
        if i[0] in w2w_red.keys():
            x_red.append((w2w_red[i[0]], i[1]))

    return x_red