Vector Space Model (VSM) is a similarity-based ranking model [1]}. This model takes each comment and a user query and represents it as an individual document vector \(\vec{d}\)  of term weights. These weights are determined using term frequency-inverse document frequency TF\(\times \) IDF [2]}. This gives a vector \(\vec{d} =\)  \((w_{1,d},w_{2,d},...,w_{n,d})\) , where \(w_{i,d}\)  is the term weight for the \(i\) th term in document \(d\) . Once the weighted vectors are defined, the cosine similarity metric computes a similarity score. The cosine similarity between two documents \(d_1\)  (i.e., comments) and \(d_2\)  (i.e., user query) is computed as follows:
\(sim(d_1,d_2)=\frac{(\sum _{i=1}^n w_{i,d_1} w_{i,d_2})}{\left(\sqrt{\sum _{i=1}^n w_{i,d_1}^2} \cdot \sqrt{\sum _{i=1}^n w_{i,d_2}^2} \right) }\) 
