def _get_question_features(conv_id, QUESTIONS):
    """
      Given conversation id and a dictionary QUESTIONS
      Returns an one-hot vector of length 8, the Xth entry being 1 iff the conversation contains question type X.
    """
    ret = {}
    for ind in range(8):
        ret['question_type%d'%(ind)] = 0
    if conv_id in QUESTIONS:
        for pair in QUESTIONS[conv_id]:
            ret['question_type%d'%(pair['question_type'])] = 1
    return ret