Implement a SparseVector for storing features. Compute TF-IDF weights for each document.