<jupyter_start><jupyter_text>the below method is just for test case and is not in exercise<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
 
def to_vector(glove_vectors, word):
    vector = glove_vectors.get(word.lower())
    if vector is None:
        vector = [0] * 50
    return vector 
 
def to_image(vector, word=''):
    fig, ax = plt.subplots(1,1)
    ax.tick_params(axis='both', which='both',
                   left=False, 
                   bottom=False, 
                   top=False,
                   labelleft=False,
                   labelbottom=False)
    ax.grid(False)
    ax.bar(range(len(vector)), vector, 0.5)
    ax.text(s=word, x=1, y=vector.max()+0.5)
    return vector

man = to_image(to_vector(glove_vectors, "man"))
woman = to_image(to_vector(glove_vectors, "woman"))
king = to_image(to_vector(glove_vectors, "king"))

queen = to_image(to_vector(glove_vectors, "queen"))
diff = to_image(king - man + woman - queen)
nd = to_image(king - man + woman)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup