calculate cosine similarity of news headlines