Calculate distance between two vectors based on a Metric

    Metrics:
    1. cosine distance. Note that in word2vec all the norms are 1 so the dot product is the same as cosine distance

def distance(a, b, metric="cosine"):
    """
    Calculate distance between two vectors based on a Metric

    Metrics:
    1. cosine distance. Note that in word2vec all the norms are 1 so the dot product is the same as cosine distance
    """
    if metric == "cosine":
        return np.dot(a, b.T)
    raise Exception("Unknown metric '{metric}'".format(metric=metric))