created part of the cosine similarity pipeline