Rachel Wicks commited on
Commit
9009fd4
1 Parent(s): 4940cb4
Files changed (1) hide show
  1. paradocs.py +3 -1
paradocs.py CHANGED
@@ -97,6 +97,7 @@ class ParaDocs(datasets.GeneratorBasedBuilder):
97
  "tgt_end_id": datasets.Value("string"),
98
  "src_lid_prob": datasets.Value("float32"),
99
  "tgt_lid_prob": datasets.Value("float32"),
 
100
  "src_docid": datasets.Value("string"),
101
  "tgt_docid": datasets.Value("string")
102
  }
@@ -139,7 +140,7 @@ class ParaDocs(datasets.GeneratorBasedBuilder):
139
  for filepath in filepaths:
140
  # logger.info("Generating examples from = %s", filepath)
141
  try:
142
- with xz.open(filepath, "rt", encoding="utf-8") as f:
143
  rstream = csv.DictReader(f,
144
  delimiter='\t',
145
  fieldnames = [
@@ -158,6 +159,7 @@ class ParaDocs(datasets.GeneratorBasedBuilder):
158
  "tgt_end_id",
159
  "src_lid_prob",
160
  "tgt_lid_prob",
 
161
  "src_docid",
162
  "tgt_docid"
163
  ],
 
97
  "tgt_end_id": datasets.Value("string"),
98
  "src_lid_prob": datasets.Value("float32"),
99
  "tgt_lid_prob": datasets.Value("float32"),
100
+ "duplication_count": datasets.Value("int64"),
101
  "src_docid": datasets.Value("string"),
102
  "tgt_docid": datasets.Value("string")
103
  }
 
140
  for filepath in filepaths:
141
  # logger.info("Generating examples from = %s", filepath)
142
  try:
143
+ with gzip.open(filepath, "rt", encoding="utf-8") as f:
144
  rstream = csv.DictReader(f,
145
  delimiter='\t',
146
  fieldnames = [
 
159
  "tgt_end_id",
160
  "src_lid_prob",
161
  "tgt_lid_prob",
162
+ "duplication_count",
163
  "src_docid",
164
  "tgt_docid"
165
  ],