Class for calculating the cosine similarity between two documents