system HF staff commited on
Commit
564eeca
1 Parent(s): f5cee21

Update files from the datasets library (from 1.16.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.16.0

Files changed (1) hide show
  1. hkcancor.py +3 -7
hkcancor.py CHANGED
@@ -286,14 +286,10 @@ class Hkcancor(datasets.GeneratorBasedBuilder):
286
 
287
  assert len(tokens) == len(
288
  pos_prf
289
- ), "Sizes do not match: {nw} vs {np} for tokens vs pos-tags in {fp}".format(
290
- nw=num_tokens, np=num_pos_tags, fp=filepath
291
- )
292
  assert len(pos_prf) == len(
293
  transcriptions
294
- ), "Sizes do not match: {np} vs {nt} for tokens vs pos-tags in {fp}".format(
295
- np=num_pos_tags, nt=num_transcriptions, fp=filepath
296
- )
297
 
298
  # Corpus doesn't come with conversation-level ids, and
299
  # multiple texts can correspond to the same tape number,
@@ -302,7 +298,7 @@ class Hkcancor(datasets.GeneratorBasedBuilder):
302
  # first few transcriptions in the conversation
303
  # to create an identifier.
304
  id_from_transcriptions = "".join(transcriptions[:5])[:5].upper()
305
- id_ = "{tn}-{rd}-{it}".format(tn=tape_number, rd=date_recorded, it=id_from_transcriptions)
306
  yield id_, {
307
  "conversation_id": id_,
308
  "speaker": current_speaker,
 
286
 
287
  assert len(tokens) == len(
288
  pos_prf
289
+ ), f"Sizes do not match: {num_tokens} vs {num_pos_tags} for tokens vs pos-tags in {filepath}"
 
 
290
  assert len(pos_prf) == len(
291
  transcriptions
292
+ ), f"Sizes do not match: {num_pos_tags} vs {num_transcriptions} for tokens vs pos-tags in {filepath}"
 
 
293
 
294
  # Corpus doesn't come with conversation-level ids, and
295
  # multiple texts can correspond to the same tape number,
 
298
  # first few transcriptions in the conversation
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,