def create_data_dict(data):

    """
    Function to convert data to dictionary format

    Args:
    -----------
    data: train/dev data as a list

    Returns:
    --------
    a dictionary containing dev/train data
    """

    train = {}
    train['para'] = []
    train['answer'] = []
    train['question'] = []
    train['question_len'] = []
    train['para_len'] = []
    train['para_mask'] = []
    train['question_mask'] = []

    for (para_idx, question_idx, para_len, question_len, answer, para_mask, ques_mask) in data:

        train['para'].append(para_idx)
        train['question'].append(question_idx)
        train['para_len'].append(para_len)
        train['question_len'].append(question_len)
        train['answer'].append(answer)
        train['para_mask'].append(para_mask)
        train['question_mask'].append(ques_mask)

    return train