File size: 632 Bytes
f57670f
 
 
 
 
 
 
f4ce74c
f57670f
 
 
 
 
 
 
 
 
f4ce74c
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from itertools import chain

import pytest
from datasets import load_dataset


def test_streaming_dataset():
    datasets = load_dataset('./3.0.0', streaming=True)
    assert set(datasets.keys()) == {'train', 'validation', 'test'}

    for split in ['train', 'validation', 'test']:
        ds = datasets[split]
        for i, e in enumerate(ds):
            assert 10 <= len(e['article']) <= 11000
            assert 10 <= len(e['highlights']) <= 500
            if i == 100:
                break


def test_batch_dataset():
    datasets = load_dataset('./3.0.0')
    assert set(datasets.keys()) == {'train', 'validation', 'test'}