asawczyn commited on
Commit
81f2a8a
1 Parent(s): 367e14d

fix loading script

Browse files
Files changed (1) hide show
  1. abusive-clauses-pl.py +12 -11
abusive-clauses-pl.py CHANGED
@@ -1,5 +1,3 @@
1
- from pathlib import Path
2
-
3
  import datasets
4
  import pandas as pd
5
 
@@ -14,10 +12,14 @@ year={2022}
14
  _DESCRIPTION = "Binary Abusive Clauses in Polish"
15
 
16
  _HOMEPAGE = ""
17
- _LICENSE = ""
18
  _LABELS = ["KLAUZULA_ABUZYWNA", "BEZPIECZNE_POSTANOWIENIE_UMOWNE"]
19
 
20
- DATA_PATH = Path(".")
 
 
 
 
21
 
22
 
23
  class AbusiveClausesConfig(datasets.BuilderConfig):
@@ -28,10 +30,6 @@ class AbusiveClausesConfig(datasets.BuilderConfig):
28
  class AbusiveClausesDataset(datasets.GeneratorBasedBuilder):
29
  VERSION = datasets.Version("1.0.0")
30
 
31
- TRAIN_FILE = DATA_PATH / "train.csv"
32
- VAL_FILE = DATA_PATH / "dev.csv"
33
- TEST_FILE = DATA_PATH / "test.csv"
34
-
35
  BUILDER_CONFIGS = [
36
  datasets.BuilderConfig(name="abusive-clauses-pl", version=VERSION)
37
  ]
@@ -56,16 +54,19 @@ class AbusiveClausesDataset(datasets.GeneratorBasedBuilder):
56
  )
57
 
58
  def _split_generators(self, dl_manager):
 
 
 
59
  return [
60
  datasets.SplitGenerator(
61
- name=datasets.Split.TRAIN, gen_kwargs={"filepath": str(self.TRAIN_FILE)}
62
  ),
63
  datasets.SplitGenerator(
64
- name=datasets.Split.TEST, gen_kwargs={"filepath": str(self.TEST_FILE)}
65
  ),
66
  datasets.SplitGenerator(
67
  name=datasets.Split.VALIDATION,
68
- gen_kwargs={"filepath": str(self.VAL_FILE)},
69
  ),
70
  ]
71
 
 
 
 
1
  import datasets
2
  import pandas as pd
3
 
 
12
  _DESCRIPTION = "Binary Abusive Clauses in Polish"
13
 
14
  _HOMEPAGE = ""
15
+ _LICENSE = "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)"
16
  _LABELS = ["KLAUZULA_ABUZYWNA", "BEZPIECZNE_POSTANOWIENIE_UMOWNE"]
17
 
18
+ _URLS = {
19
+ "train": "https://huggingface.co/datasets/laugustyniak/abusive-clauses-pl/resolve/main/train.csv",
20
+ "dev": "https://huggingface.co/datasets/laugustyniak/abusive-clauses-pl/resolve/main/dev.csv",
21
+ "test": "https://huggingface.co/datasets/laugustyniak/abusive-clauses-pl/resolve/main/test.csv",
22
+ }
23
 
24
 
25
  class AbusiveClausesConfig(datasets.BuilderConfig):
 
30
  class AbusiveClausesDataset(datasets.GeneratorBasedBuilder):
31
  VERSION = datasets.Version("1.0.0")
32
 
 
 
 
 
33
  BUILDER_CONFIGS = [
34
  datasets.BuilderConfig(name="abusive-clauses-pl", version=VERSION)
35
  ]
 
54
  )
55
 
56
  def _split_generators(self, dl_manager):
57
+ urls_to_download = _URLS
58
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
59
+
60
  return [
61
  datasets.SplitGenerator(
62
+ name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}
63
  ),
64
  datasets.SplitGenerator(
65
+ name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}
66
  ),
67
  datasets.SplitGenerator(
68
  name=datasets.Split.VALIDATION,
69
+ gen_kwargs={"filepath": downloaded_files["dev"]},
70
  ),
71
  ]
72