Added check on detective.utils.get_topic_model to avoid index out of range #338