def METHOD_NAME(args):
    dir_list = os.walk(args.root_dir)
    print('Start Converting')
    data, websites, qas, answers = [], [], [], []
    last_domain = None
    for d, _, fs in dir_list:
        for f in fs:
            if f != 'dataset.csv':
                continue
            print('Now converting', d + '/' + f)
            raw_data = list(csv.DictReader(open(osp.join(d, f))))
            curr_domain = d.split('/')[-2]
            if last_domain != curr_domain and last_domain is not None:
                domain = {'domain': last_domain, 'websites': websites}
                data.append(domain)
                websites = []
            last_domain = curr_domain
            raw_data.sort(key=itemgetter('id'))
            last = raw_data[0]
            for i in range(len(raw_data)):
                current = raw_data[i]
                if i != 0:
                    qa = {'question': last['question'],
                          'id'      : last['id'],
                          'answers' : answers}  # , 'type': last['type']}
                    qas.append(qa)
                    answers = []
                if last['id'][:-5] != current['id'][:-5]:
                    website = {'qas': qas, 'page_id': last['id'][2:-5]}
                    websites.append(website)
                    qas = []
                answer = {'text'        : current['answer'],
                          'element_id'  : int(current['element_id']),
                          'answer_start': int(current['answer_start'])}
                answers.append(answer)
                last = current
            if len(answers) > 0:
                qa = {'question': last['question'],
                      'id'      : last['id'],
                      'answers' : answers}  # , 'type'    : last['type']}
                qas.append(qa)
                answers = []
            if len(qas) > 0:
                website = {'qas': qas, 'page_id': last['id'][2:-5]}
                websites.append(website)
                qas = []
    domain = {'domain': last_domain, 'websites': websites}
    data.append(domain)
    dataset = {'version': args.version, 'data': data}
    print('Converting Finished\n')
    return dataset