Added saving the weights for the documents