SuzanaB commited on
Commit
ace14d4
1 Parent(s): f524ffb

Fix file paths and special lines

Browse files
Files changed (1) hide show
  1. setimes_sr.py +8 -2
setimes_sr.py CHANGED
@@ -38,6 +38,12 @@ _URLs = {
38
  'ud': 'https://huggingface.co/datasets/classla/setimes_sr/raw/main/data_ud.zip'
39
  }
40
 
 
 
 
 
 
 
41
 
42
  class SeTimesSr(datasets.GeneratorBasedBuilder):
43
  VERSION = datasets.Version('1.0.1')
@@ -163,7 +169,7 @@ class SeTimesSr(datasets.GeneratorBasedBuilder):
163
 
164
  def _split_generators(self, dl_manager):
165
  """Returns SplitGenerators."""
166
- data_dir = dl_manager.download_and_extract(_URLs[self.config.name])
167
 
168
  if self.config.name == 'ud':
169
  training_file = 'train_ner_ud.conllup'
@@ -206,7 +212,7 @@ class SeTimesSr(datasets.GeneratorBasedBuilder):
206
  uds = []
207
  data_id = 0
208
  for line in f:
209
- if line and not line == '\n':
210
  if line.startswith('#'):
211
  if line.startswith('# sent_id'):
212
  if tokens:
38
  'ud': 'https://huggingface.co/datasets/classla/setimes_sr/raw/main/data_ud.zip'
39
  }
40
 
41
+ _DATA_DIRS = {
42
+ 'ner': 'data_ner',
43
+ 'upos': 'data_ner',
44
+ 'ud': 'data_ud'
45
+ }
46
+
47
 
48
  class SeTimesSr(datasets.GeneratorBasedBuilder):
49
  VERSION = datasets.Version('1.0.1')
169
 
170
  def _split_generators(self, dl_manager):
171
  """Returns SplitGenerators."""
172
+ data_dir = os.path.join(dl_manager.download_and_extract(_URLs[self.config.name]), _DATA_DIRS[self.config.name])
173
 
174
  if self.config.name == 'ud':
175
  training_file = 'train_ner_ud.conllup'
212
  uds = []
213
  data_id = 0
214
  for line in f:
215
+ if line and not line == '\n' and not line.startswith('# global.columns'):
216
  if line.startswith('#'):
217
  if line.startswith('# sent_id'):
218
  if tokens: