qanastek commited on
Commit
4fa03b2
1 Parent(s): 5c9e1c8
Files changed (1) hide show
  1. WMT-16-PubMed.py +5 -1
WMT-16-PubMed.py CHANGED
@@ -3,6 +3,7 @@
3
 
4
  """WMT'16 Biomedical Translation Task - PubMed parallel datasets"""
5
 
 
6
  import datasets
7
  import pandas as pd
8
 
@@ -127,7 +128,10 @@ class WMT_16_PubMed(datasets.GeneratorBasedBuilder):
127
 
128
  key_ = 0
129
 
130
- df = pd.read_csv(filepath, compression='gzip', header=0, sep=',')
 
 
 
131
 
132
  for index, row in df.loc[df['lang'] == self.config.name].iterrows():
133
 
 
3
 
4
  """WMT'16 Biomedical Translation Task - PubMed parallel datasets"""
5
 
6
+ import gzip
7
  import datasets
8
  import pandas as pd
9
 
 
128
 
129
  key_ = 0
130
 
131
+ with open(filepath, 'rb') as fd:
132
+ gzip_fd = gzip.GzipFile(fileobj=fd)
133
+ df = pd.read_csv(gzip_fd)
134
+ # df = pd.read_csv(filepath, compression='gzip', header=0, sep=',')
135
 
136
  for index, row in df.loc[df['lang'] == self.config.name].iterrows():
137