Add method to invert weighted matrix of documents