Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions datasets/swda/swda.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import csv
import datetime
import glob
import io
import os
import re

Expand Down Expand Up @@ -435,10 +434,8 @@ def _split_generators(self, dl_manager):
dl_dir = dl_manager.download_and_extract(_URL)
# Use swda/ folder.
data_dir = os.path.join(dl_dir, "swda")
# Handle partitions files.
urls_to_download = self._URLS
# Download extract and return paths of split files.
downloaded_files = dl_manager.download_and_extract(urls_to_download)
# Handle partitions files: download extract and return paths of split files.
downloaded_files = dl_manager.download(self._URLS)

return [
# Return whole data path and train splits file downloaded path.
Expand Down Expand Up @@ -476,7 +473,8 @@ def _generate_examples(self, data_dir, split_file):
"""

# Read in the split file.
split_file = io.open(file=split_file, mode="r", encoding="utf-8").read().splitlines()
with open(file=split_file, mode="r", encoding="utf-8") as f:
split_file = f.read().splitlines()
# Read in corpus data using split files.
corpus = CorpusReader(src_dirname=data_dir, split_file=split_file)
# Generate examples.
Expand Down