mathiascreutz commited on
Commit
80f7843
1 Parent(s): 3bd8cee

Testing configs

Browse files
Files changed (1) hide show
  1. opusparcus.py +4 -5
opusparcus.py CHANGED
@@ -56,7 +56,7 @@ _VERSION = datasets.Version("1.0.0", "")
56
  class OpusparcusConfig(datasets.BuilderConfig):
57
  """BuilderConfig for Opusparcus."""
58
 
59
- def __init__(self, lang=None, quality=100, **kwargs):
60
  """BuilderConfig for Wikipedia.
61
  Args:
62
  language: string, the language code for the Wikipedia dump to use.
@@ -74,7 +74,7 @@ class OpusparcusConfig(datasets.BuilderConfig):
74
 
75
  LANGS = [ "de", "en", "fi", "fr", "ru", "sv" ]
76
 
77
- QUALITIES = [ 95, 90, 85, 80, 75, 70, 65, 60 ]
78
 
79
  class Opusparcus(datasets.GeneratorBasedBuilder):
80
 
@@ -90,9 +90,8 @@ class Opusparcus(datasets.GeneratorBasedBuilder):
90
  # data = datasets.load_dataset('my_dataset', 'first_domain')
91
  # data = datasets.load_dataset('my_dataset', 'second_domain')
92
  BUILDER_CONFIGS = [
93
- OpusparcusConfig(lang=lang, version=_VERSION) for lang in LANGS
94
  ]
95
- BUILDER_CONFIGS.extend(OpusparcusConfig(lang=lang, quality=quality, version=_VERSION) for lang in LANGS for quality in QUALITIES)
96
 
97
  #DEFAULT_CONFIG_NAME = "test" # It's not mandatory to have a default configuration. Just use one if it make sense.
98
 
@@ -165,7 +164,7 @@ class Opusparcus(datasets.GeneratorBasedBuilder):
165
  ]
166
 
167
  def _generate_examples(
168
- self, lang, quality, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
169
  ):
170
 
171
  """ Yields examples as (key, example) tuples. """
 
56
  class OpusparcusConfig(datasets.BuilderConfig):
57
  """BuilderConfig for Opusparcus."""
58
 
59
+ def __init__(self, lang=None, quality=None, **kwargs):
60
  """BuilderConfig for Wikipedia.
61
  Args:
62
  language: string, the language code for the Wikipedia dump to use.
 
74
 
75
  LANGS = [ "de", "en", "fi", "fr", "ru", "sv" ]
76
 
77
+ QUALITIES = [ 100, 95, 90, 85, 80, 75, 70, 65, 60 ]
78
 
79
  class Opusparcus(datasets.GeneratorBasedBuilder):
80
 
 
90
  # data = datasets.load_dataset('my_dataset', 'first_domain')
91
  # data = datasets.load_dataset('my_dataset', 'second_domain')
92
  BUILDER_CONFIGS = [
93
+ OpusparcusConfig(lang=lang, quality=quality, version=_VERSION) for lang in LANGS for quality in QUALITIES)
94
  ]
 
95
 
96
  #DEFAULT_CONFIG_NAME = "test" # It's not mandatory to have a default configuration. Just use one if it make sense.
97
 
 
164
  ]
165
 
166
  def _generate_examples(
167
+ self, lang, quality=100, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
168
  ):
169
 
170
  """ Yields examples as (key, example) tuples. """