Cosine Text Similarity algorithm implementation.