system HF staff commited on
Commit
5a1a619
1 Parent(s): 2d375c5

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. jfleg.py +2 -4
jfleg.py CHANGED
@@ -129,16 +129,14 @@ class Jfleg(datasets.GeneratorBasedBuilder):
129
 
130
  corrections = []
131
  for n in range(0, 4):
132
- correction_file = filepath["ref{n}".format(n=n)]
133
  with open(correction_file, encoding="utf-8") as f:
134
  correction_sentences = f.read().split("\n")
135
  num_correction = len(correction_sentences)
136
 
137
  assert len(correction_sentences) == len(
138
  source_sentences
139
- ), "Sizes do not match: {ns} vs {nr} for {sf} vs {cf}.".format(
140
- ns=num_source, nr=num_correction, sf=source_file, cf=correction_file
141
- )
142
  corrections.append(correction_sentences)
143
 
144
  corrected_sentences = list(zip(*corrections))
129
 
130
  corrections = []
131
  for n in range(0, 4):
132
+ correction_file = filepath[f"ref{n}"]
133
  with open(correction_file, encoding="utf-8") as f:
134
  correction_sentences = f.read().split("\n")
135
  num_correction = len(correction_sentences)
136
 
137
  assert len(correction_sentences) == len(
138
  source_sentences
139
+ ), f"Sizes do not match: {num_source} vs {num_correction} for {source_file} vs {correction_file}."
 
 
140
  corrections.append(correction_sentences)
141
 
142
  corrected_sentences = list(zip(*corrections))