In order to check similarity between 2 vectors, we can check the distance between them. There are a few different metrics to measure distance between 2 vectors.
import numpy as np
Measures the angle between 2 non-zero vectors. It ranges between
def cosine_similarity(p, q):