Rather than rebuild a new the document-topic matrix, use what sklearn outputs. This will simplify the code greatly.