SuzanaB commited on
Commit
112cb66
1 Parent(s): 5d6a1d1

Fix file paths and special lines

Browse files
Files changed (1) hide show
  1. reldi_sr.py +3 -2
reldi_sr.py CHANGED
@@ -33,6 +33,7 @@ _URL = 'https://huggingface.co/datasets/classla/reldi_sr/raw/main/data.zip'
33
  _TRAINING_FILE = 'train_all.conllup'
34
  _DEV_FILE = 'dev_all.conllup'
35
  _TEST_FILE = 'test_all.conllup'
 
36
 
37
 
38
  class ReldiSr(datasets.GeneratorBasedBuilder):
@@ -88,7 +89,7 @@ class ReldiSr(datasets.GeneratorBasedBuilder):
88
 
89
  def _split_generators(self, dl_manager):
90
  """Returns SplitGenerators."""
91
- data_dir = dl_manager.download_and_extract(_URL)
92
 
93
  return [
94
  datasets.SplitGenerator(
@@ -120,7 +121,7 @@ class ReldiSr(datasets.GeneratorBasedBuilder):
120
  iob_tags = []
121
  data_id = 0
122
  for line in f:
123
- if line and not line == '\n':
124
  if line.startswith('# sent_id'):
125
  if tokens:
126
  yield data_id, {
 
33
  _TRAINING_FILE = 'train_all.conllup'
34
  _DEV_FILE = 'dev_all.conllup'
35
  _TEST_FILE = 'test_all.conllup'
36
+ _DATA_DIR = 'data'
37
 
38
 
39
  class ReldiSr(datasets.GeneratorBasedBuilder):
 
89
 
90
  def _split_generators(self, dl_manager):
91
  """Returns SplitGenerators."""
92
+ data_dir = os.path.join(dl_manager.download_and_extract(_URL), _DATA_DIR)
93
 
94
  return [
95
  datasets.SplitGenerator(
 
121
  iob_tags = []
122
  data_id = 0
123
  for line in f:
124
+ if line and not line == '\n' and not line.startswith('# global.columns'):
125
  if line.startswith('# sent_id'):
126
  if tokens:
127
  yield data_id, {