Rewrite doc-vectors to keep text and class keys