def METHOD_NAME(range, savepath):
    templates = []
    with open('templates.csv', newline='') as csvfile:
        reader = csv.reader(csvfile, delimiter = '.')
        for row in reader:
            templates.append(row[0].strip())
    raw = []
    with open('./data/pubchem.csv') as f:
        lines = csv.reader(f)
        next(lines)
        for line in list(lines)[range[0]:range[1]]:
            smile = line[15]
            template = templates[random.randrange(0, 25)]
            question = template.format(smile)
            raw.append((question, smile))
    out = labelling(raw)
    with open(savepath, 'w') as f:
        for datum in out:
            json.dump(datum, f)
            f.write('\n')