fix a bug in writeDocTopicInference