Datasets:
Commit
·
8b2a7d2
1
Parent(s):
4e63934
Update dataset (#1)
Browse files- Update README due to deprecated metadata (367e14dfe21f29aeb14c45337926a69d7ec1fd9e)
- fix loading script (81f2a8ab9fee304890f18f2e78d21881be17da2e)
- add stats to README (95c9aeb8e18f0cff5cb09f2b2429cac0c0bd62ee)
Co-authored-by: Albert Sawczyn <asawczyn@users.noreply.huggingface.co>
- README.md +18 -3
- abusive-clauses-pl.py +12 -11
README.md
CHANGED
@@ -3,10 +3,10 @@ annotations_creators:
|
|
3 |
- hired_annotators
|
4 |
language_creators:
|
5 |
- found
|
6 |
-
|
7 |
- pl
|
8 |
-
|
9 |
-
-
|
10 |
multilinguality:
|
11 |
- monolingual
|
12 |
size_categories:
|
@@ -27,6 +27,21 @@ Our dataset treats ''unfair contractual term'' as the equivalent of an abusive c
|
|
27 |
|
28 |
On the EU and at the national such as the Polish levels, agencies cannot check possible agreements by hand. Hence, we took the first step to evaluate the possibility of accelerating this process. We created a dataset and machine learning models to automate potentially abusive clauses detection partially. Consumer protection organizations and agencies can use these resources to make their work more effective and efficient. Moreover, consumers can automatically analyze contracts and understand what they agree upon.
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
## License
|
31 |
|
32 |
[Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
|
|
3 |
- hired_annotators
|
4 |
language_creators:
|
5 |
- found
|
6 |
+
language:
|
7 |
- pl
|
8 |
+
license:
|
9 |
+
- cc-by-nc-sa-4.0
|
10 |
multilinguality:
|
11 |
- monolingual
|
12 |
size_categories:
|
|
|
27 |
|
28 |
On the EU and at the national such as the Polish levels, agencies cannot check possible agreements by hand. Hence, we took the first step to evaluate the possibility of accelerating this process. We created a dataset and machine learning models to automate potentially abusive clauses detection partially. Consumer protection organizations and agencies can use these resources to make their work more effective and efficient. Moreover, consumers can automatically analyze contracts and understand what they agree upon.
|
29 |
|
30 |
+
## Data splits
|
31 |
+
|
32 |
+
| Subset | Cardinality (sentences) |
|
33 |
+
| ----------- | ----------------------: |
|
34 |
+
| train | 4284 |
|
35 |
+
| dev | 1519 |
|
36 |
+
| test | 3453 |
|
37 |
+
|
38 |
+
## Class distribution
|
39 |
+
|
40 |
+
| Class | train | dev | test |
|
41 |
+
|:--------------------------------|--------:|-------------:|-------:|
|
42 |
+
| BEZPIECZNE_POSTANOWIENIE_UMOWNE | 0.5458 | 0.3002 | 0.6756 |
|
43 |
+
| KLAUZULA_ABUZYWNA | 0.4542 | 0.6998 | 0.3244 |
|
44 |
+
|
45 |
## License
|
46 |
|
47 |
[Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
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 |
-
|
|
|
|
|
|
|
|
|
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":
|
62 |
),
|
63 |
datasets.SplitGenerator(
|
64 |
-
name=datasets.Split.TEST, gen_kwargs={"filepath":
|
65 |
),
|
66 |
datasets.SplitGenerator(
|
67 |
name=datasets.Split.VALIDATION,
|
68 |
-
gen_kwargs={"filepath":
|
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 |
|