Moving some useful functions from RMallet to ParallelTopicModel