albertvillanova HF staff commited on
Commit
828708b
1 Parent(s): 652d6f4
Files changed (1) hide show
  1. hkcancor.py +6 -3
hkcancor.py CHANGED
@@ -61,7 +61,9 @@ _HOMEPAGE = "http://compling.hss.ntu.edu.sg/hkcancor/"
61
 
62
  _LICENSE = "CC BY 4.0"
63
 
64
- _URL = "http://compling.hss.ntu.edu.sg/hkcancor/data/hkcancor-utf8.zip"
 
 
65
 
66
 
67
  class Hkcancor(datasets.GeneratorBasedBuilder):
@@ -243,7 +245,7 @@ class Hkcancor(datasets.GeneratorBasedBuilder):
243
 
244
  def _generate_examples(self, data_dir, split):
245
  """Yields examples."""
246
-
247
  downloaded_files = [os.path.join(data_dir, fn) for fn in sorted(os.listdir(data_dir))]
248
  for filepath in downloaded_files:
249
  # Each file in the corpus contains one conversation
@@ -299,7 +301,7 @@ class Hkcancor(datasets.GeneratorBasedBuilder):
299
  # to create an identifier.
300
  id_from_transcriptions = "".join(transcriptions[:5])[:5].upper()
301
  id_ = f"{tape_number}-{date_recorded}-{id_from_transcriptions}"
302
- yield id_, {
303
  "conversation_id": id_,
304
  "speaker": current_speaker,
305
  "turn_number": turn_number,
@@ -308,3 +310,4 @@ class Hkcancor(datasets.GeneratorBasedBuilder):
308
  "pos_tags_prf": pos_prf,
309
  "pos_tags_ud": pos_ud,
310
  }
 
 
61
 
62
  _LICENSE = "CC BY 4.0"
63
 
64
+ # Original URL gives connection error
65
+ # _URL = "http://compling.hss.ntu.edu.sg/hkcancor/data/hkcancor-utf8.zip"
66
+ _URL = "https://github.com/fcbond/hkcancor/raw/master/data/hkcancor-utf8.zip"
67
 
68
 
69
  class Hkcancor(datasets.GeneratorBasedBuilder):
 
245
 
246
  def _generate_examples(self, data_dir, split):
247
  """Yields examples."""
248
+ key = 0
249
  downloaded_files = [os.path.join(data_dir, fn) for fn in sorted(os.listdir(data_dir))]
250
  for filepath in downloaded_files:
251
  # Each file in the corpus contains one conversation
 
301
  # to create an identifier.
302
  id_from_transcriptions = "".join(transcriptions[:5])[:5].upper()
303
  id_ = f"{tape_number}-{date_recorded}-{id_from_transcriptions}"
304
+ yield key, {
305
  "conversation_id": id_,
306
  "speaker": current_speaker,
307
  "turn_number": turn_number,
 
310
  "pos_tags_prf": pos_prf,
311
  "pos_tags_ud": pos_ud,
312
  }
313
+ key += 1