iiegn commited on
Commit
958f654
·
verified ·
1 Parent(s): 8fe2f7a

Feat: Add homepage,name; remove license,data_url; fix description,license

Browse files
tools/templates/universal_dependencies.tmpl CHANGED
@@ -1,5 +1,7 @@
1
  ### THIS IS A GENERATED FILE.
2
 
 
 
3
  import conllu
4
 
5
  import datasets
@@ -43,32 +45,31 @@ _UD_DATASETS = {
43
  }
44
 
45
 
46
- class UniversaldependenciesConfig(datasets.BuilderConfig):
47
- """BuilderConfig for Universal dependencies"""
48
-
49
- def __init__(self, data_url, **kwargs):
50
- super(UniversaldependenciesConfig,
51
- self).__init__(version=datasets.Version("{{ ud_ver }}.0", ""), **kwargs)
52
 
53
- self.data_url = data_url
 
54
 
55
 
56
  class UniversalDependencies(datasets.GeneratorBasedBuilder):
57
- VERSION = datasets.Version("{{ ud_ver }}.0")
 
58
  BUILDER_CONFIGS = [
59
- UniversaldependenciesConfig(
60
- data_url="https://github.com/UniversalDependencies/" + _UD_DATASETS[name]["test"][0].split("/")[0],
61
  name=name,
62
- description=_DESCRIPTIONS[name],
63
- # license=_LICENSES[name],
64
  )
65
  for name in _NAMES
66
  ]
67
- BUILDER_CONFIG_CLASS = UniversaldependenciesConfig
68
 
69
  def _info(self):
70
  return datasets.DatasetInfo(
71
- description=_DESCRIPTION,
 
 
 
72
  features=datasets.Features(
73
  {
74
  "idx": datasets.Value("string"),
@@ -108,8 +109,6 @@ class UniversalDependencies(datasets.GeneratorBasedBuilder):
108
  }
109
  ),
110
  supervised_keys=None,
111
- homepage="https://universaldependencies.org/",
112
- citation=_CITATION,
113
  )
114
 
115
  def _split_generators(self, dl_manager):
@@ -150,7 +149,7 @@ class UniversalDependencies(datasets.GeneratorBasedBuilder):
150
  for path in filepath:
151
  with open(path, "r", encoding="utf-8") as data_file:
152
  tokenlist = list(conllu.parse_incr(data_file))
153
- for sent in tokenlist:
154
  if "sent_id" in sent.metadata:
155
  idx = sent.metadata["sent_id"]
156
  else:
 
1
  ### THIS IS A GENERATED FILE.
2
 
3
+ from dataclasses import dataclass
4
+
5
  import conllu
6
 
7
  import datasets
 
45
  }
46
 
47
 
48
+ @dataclass
49
+ class UniversalDependenciesConfig(datasets.BuilderConfig):
50
+ """BuilderConfig for Universal Dependencies"""
 
 
 
51
 
52
+ def __init__(self, name: str, **kwargs):
53
+ super().__init__(name, version=datasets.Version("{{ ud_ver }}.0"), **kwargs)
54
 
55
 
56
  class UniversalDependencies(datasets.GeneratorBasedBuilder):
57
+ """Universal Dependencies Datasets"""
58
+
59
  BUILDER_CONFIGS = [
60
+ UniversalDependenciesConfig(
 
61
  name=name,
 
 
62
  )
63
  for name in _NAMES
64
  ]
65
+ BUILDER_CONFIG_CLASS = UniversalDependenciesConfig
66
 
67
  def _info(self):
68
  return datasets.DatasetInfo(
69
+ homepage=f"https://github.com/UniversalDependencies/" + _UD_DATASETS[self.config.name]["test"][0].split("/")[0],
70
+ description=_DESCRIPTIONS[self.config.name],
71
+ citation=None, # would need to be the dataset specific citation
72
+ license=_LICENSES[self.config.name],
73
  features=datasets.Features(
74
  {
75
  "idx": datasets.Value("string"),
 
109
  }
110
  ),
111
  supervised_keys=None,
 
 
112
  )
113
 
114
  def _split_generators(self, dl_manager):
 
149
  for path in filepath:
150
  with open(path, "r", encoding="utf-8") as data_file:
151
  tokenlist = list(conllu.parse_incr(data_file))
152
+ for sent in tokenlist:
153
  if "sent_id" in sent.metadata:
154
  idx = sent.metadata["sent_id"]
155
  else: