Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 977c0b2

Browse files
committed
Signed-off-by: Abhishek P (VMware) <pab@vmware.com>
Converted HFDatasetSplitReader to HFDatasetReader Now all splits can be used in the same reader Support for both pre-load of all splits or on demand load of the split Reduced tests to glue-cola dataset:config which is ~ 0.36MB download Updated dataset dep to be the range of >=1.5.0 and <1.6.0
1 parent 6e613b9 commit 977c0b2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

allennlp/data/dataset_readers/huggingface_datasets_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from datasets.features import Value
99

1010
# TODO pab complete the documentation comments
11-
class HuggingfaceDatasetSplitReader(DatasetReader):
11+
class HuggingfaceDatasetReader(DatasetReader):
1212
"""
1313
This reader implementation wraps the huggingface datasets package
1414
to utilize it's dataset management functionality and load the information in AllenNLP friendly formats

tests/data/dataset_readers/huggingface_datasets_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from allennlp.data.dataset_readers.huggingface_datasets_reader import HuggingfaceDatasetSplitReader
3+
from allennlp.data.dataset_readers.huggingface_datasets_reader import HuggingfaceDatasetReader
44
import logging
55

66
logger = logging.getLogger(__name__)
@@ -15,7 +15,7 @@ class HuggingfaceDatasetSplitReaderTest:
1515
"""
1616
@pytest.mark.parametrize("dataset, config, split", (("glue", "cola", "train"), ("glue", "cola", "test")))
1717
def test_read_for_datasets_requiring_config(self, dataset, config, split):
18-
huggingface_reader = HuggingfaceDatasetSplitReader(dataset_name=dataset, config_name=config)
18+
huggingface_reader = HuggingfaceDatasetReader(dataset_name=dataset, config_name=config)
1919
instances = list(huggingface_reader.read(split))
2020
assert len(instances) == len(huggingface_reader.datasets[split])
2121
print(instances[0], print(huggingface_reader.datasets[split][0]))

0 commit comments

Comments
 (0)