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

Commit

Permalink
Quick changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-P committed Aug 11, 2021
1 parent 3192d70 commit e32c5b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions allennlp/data/dataset_readers/huggingface_datasets_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ def _map_Feature(
)

elif isinstance(feature_type, Sequence):
fields_to_be_added[feature_name] = _map_Sequence(
feature_name, value, feature_type.feature, tokenizer
)
if type(value) == dict:
fields_to_be_added = _map_Dict(feature_type, value, tokenizer)
else:
fields_to_be_added[feature_name] = _map_Sequence(
feature_name, value, feature_type.feature, tokenizer
)

elif isinstance(feature_type, Translation):
fields_to_be_added = _map_Translation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_read_known_supported_datasets_without_config(self, dataset):
# print(instances[0])


@pytest.mark.skip("Requires implementation of Dict")
# @pytest.mark.skip("Requires implementation of Dict")
def test_squad(self):
instances = list(HuggingfaceDatasetReader("squad").read("train"))
print(instances[0])
Expand All @@ -172,9 +172,9 @@ def test_open_web_text(self):
instances = list(HuggingfaceDatasetReader("openwebtext").read("plain_text"))
print(instances[0])

@pytest.mark.skip("Requires mapping of dict type")
# @pytest.mark.skip("Requires mapping of dict type")
def test_mocha(self):
instances = list(HuggingfaceDatasetReader("mocha").read("test"))
reader = HuggingfaceDatasetReader("mocha").read("test")
print(instances[0])

@pytest.mark.skip("Requires implementation of Dict")
Expand Down

0 comments on commit e32c5b0

Please sign in to comment.