Update files from the datasets library (from 1.16.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.16.0
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}"
|
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: {
|
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))
|