load_questions.py 319 Bytes
Newer Older
liuwy's avatar
liuwy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import jsonlines


def read_jsonl(path):
    content = []
    with jsonlines.open(path, "r") as json_file:
        for obj in json_file.iter(type=dict, skip_invalid=True):
            content.append(obj)
    return content


questions = read_jsonl('data/question.jsonl')

for question in questions:
    print(question)