def main():
    data_set = SquADDataSet(data_path='./data/SQuAD/train-v1.1.json')
    print('size: ', data_set.size())
    for index in range(20):
        context, question, answer = data_set.get_data(index)
        print('#' + str(index) + ' context:', context)
        print('#' + str(index) + ' question:', question)
        print('#' + str(index) + ' answer:', answer)
        print('++++++++++++++++++++++++++++++++++++++++++++++++++++')
Example #2
0
def main():
    with open('./data/SQuAD/train-v1.1.json') as file:
        ds = json.load(file)
        data_set = SquADDataSet(queries=ds)
    # data_set = SquADDataSet(data_path='./data/SQuAD/train-v1.1.json')
    print('size: ', data_set.size())
    for index, value in enumerate(data_set.get_data()[0:1]):
        context, question, answer = value
        print('#' + str(index) + ' context:', context)
        print('#' + str(index) + ' question:', question)
        print('#' + str(index) + ' answer:', answer)
        print('++++++++++++++++++++++++++++++++++++++++++++++++++++')