faster way to compute cosine scores by calculating the dot product