xsum_dutch / test_xsum_dutch.py
yhavinga's picture
Update test
5dac9d8
raw
history blame contribute delete
770 Bytes
from itertools import chain
import pytest
from datasets import load_dataset
def test_streaming_dataset():
datasets = load_dataset("./xsum_dutch.py", 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["document"]) <= 11000
assert 10 <= len(e["summary"]) <= 500
if i == 100:
break
def test_train_split():
ds = load_dataset("./xsum_dutch.py", split="train" + f"[:{2000}]")
assert len(ds) == 2000
def test_batch_dataset():
datasets = load_dataset("./xsum_dutch.py")
assert set(datasets.keys()) == {"train", "validation", "test"}