joelniklaus commited on
Commit
819763d
1 Parent(s): 600864f

added aggregate column for all topics

Browse files
Files changed (5) hide show
  1. README.md +3 -2
  2. convert_to_hf_dataset.py +12 -1
  3. test.jsonl +2 -2
  4. train.jsonl +2 -2
  5. validation.jsonl +2 -2
README.md CHANGED
@@ -4,7 +4,7 @@ annotations_creators:
4
  - other
5
  language_creators:
6
  - found
7
- languages:
8
  - de
9
  - en
10
  - it
@@ -94,7 +94,7 @@ The dataset contains the following fields:
94
  - `sentence`: The sentence to be classified.
95
  - `unfairness_level`: The unfairness level assigned to the sentence (if two clauses apply, the higher unfairness level is assigned here).
96
 
97
- The documents have been annotated using nine tags that represent different categories of clause unfairness. These tags are:
98
  - `a` = Arbitration: *”This clause requires or allows the parties to resolve their disputes through an arbitration process, before the case could go to court. It is therefore considered a kind of forum selection clause. However, such a clause may or may not specify that arbitration should occur within a specific jurisdiction. Clauses stipulating that the arbitration should (1) take place in a state other than the state of consumer’s residence and/or (2) be based not on law but on arbiter’s discretion were marked as clearly unfair.”* (Lippi et al., 2019)
99
  - `ch` = Unilateral change: *"This clause specifies the conditions under which the service provider could amend and modify the terms of service and/or the service itself. Such clauses were always considered as potentially unfair. This is because the ECJ has not yet issued a judgment in this regard, though the Annex to the Direc- tive contains several examples supporting such a qualification."* (Lippi et al., 2019)
100
  - `cr` = Content removal : *"This gives the provider a right to modify/delete user’s content, including in-app purchases, and sometimes specifies the conditions under which the service provider may do so. As in the case of unilateral termination, clauses that indicate conditions for content removal were marked as potentially unfair, whereas clauses stipulating that the service provider may remove content in his full discretion, and/or at any time for any or no reasons and/or without notice nor possibility to retrieve the content were marked as clearly unfair."* (Lippi et al., 2019)
@@ -104,6 +104,7 @@ The documents have been annotated using nine tags that represent different categ
104
  - `ter` = Unilateral termination: *"This clause gives provider the right to suspend and/or terminate the service and/or the contract, and sometimes details the circumstances under which the provider claims to have a right to do so. Unilateral termination clauses that specify reasons for termination were marked as potentially unfair. Whereas clauses stipulating that the service provider may suspend or terminate the service at any time for any or no reasons and/or without notice were marked as clearly unfair."* (Lippi et al., 2019)
105
  - `use` = Contract by using: *"This clause stipulates that the consumer is bound by the terms of use of a specific service, simply by using the service, without even being required to mark that he or she has read and accepted them. We always marked such clauses as potentially unfair. The reason for this choice is that a good argument can be offered for these clauses to be unfair, because they originate an imbalance in rights and duties of the parties, but this argument has no decisive authoritative backing yet, since the ECJ has never assessed a clause of this type."* (Lippi et al., 2019)
106
  - `pinc` = Privacy included: This tag identifies *"clauses stating that consumers consent to the privacy policy simply by using the service. Such clauses have been always considered potentially unfair"* (Drawzeski et al., 2021)
 
107
 
108
  *”We assumed that each type of clause could be classified as either clearly fair, or potentially unfair, or clearly unfair. In order to mark the different degrees of (un)fairness we appended a numeric value to each XML tag, with 1 meaning clearly fair, 2 potentially unfair, and 3 clearly unfair. Nested tags were used to annotate text segments relevant to more than one type of clause. With clauses covering multiple paragraphs, we chose to tag each paragraph separately, possibly with different degrees of (un)fairness.”* (Lippi et al., 2019)
109
 
4
  - other
5
  language_creators:
6
  - found
7
+ language:
8
  - de
9
  - en
10
  - it
94
  - `sentence`: The sentence to be classified.
95
  - `unfairness_level`: The unfairness level assigned to the sentence (if two clauses apply, the higher unfairness level is assigned here).
96
 
97
+ The documents have been annotated using nine tags that represent different categories of clause unfairness. These boolean tags are:
98
  - `a` = Arbitration: *”This clause requires or allows the parties to resolve their disputes through an arbitration process, before the case could go to court. It is therefore considered a kind of forum selection clause. However, such a clause may or may not specify that arbitration should occur within a specific jurisdiction. Clauses stipulating that the arbitration should (1) take place in a state other than the state of consumer’s residence and/or (2) be based not on law but on arbiter’s discretion were marked as clearly unfair.”* (Lippi et al., 2019)
99
  - `ch` = Unilateral change: *"This clause specifies the conditions under which the service provider could amend and modify the terms of service and/or the service itself. Such clauses were always considered as potentially unfair. This is because the ECJ has not yet issued a judgment in this regard, though the Annex to the Direc- tive contains several examples supporting such a qualification."* (Lippi et al., 2019)
100
  - `cr` = Content removal : *"This gives the provider a right to modify/delete user’s content, including in-app purchases, and sometimes specifies the conditions under which the service provider may do so. As in the case of unilateral termination, clauses that indicate conditions for content removal were marked as potentially unfair, whereas clauses stipulating that the service provider may remove content in his full discretion, and/or at any time for any or no reasons and/or without notice nor possibility to retrieve the content were marked as clearly unfair."* (Lippi et al., 2019)
104
  - `ter` = Unilateral termination: *"This clause gives provider the right to suspend and/or terminate the service and/or the contract, and sometimes details the circumstances under which the provider claims to have a right to do so. Unilateral termination clauses that specify reasons for termination were marked as potentially unfair. Whereas clauses stipulating that the service provider may suspend or terminate the service at any time for any or no reasons and/or without notice were marked as clearly unfair."* (Lippi et al., 2019)
105
  - `use` = Contract by using: *"This clause stipulates that the consumer is bound by the terms of use of a specific service, simply by using the service, without even being required to mark that he or she has read and accepted them. We always marked such clauses as potentially unfair. The reason for this choice is that a good argument can be offered for these clauses to be unfair, because they originate an imbalance in rights and duties of the parties, but this argument has no decisive authoritative backing yet, since the ECJ has never assessed a clause of this type."* (Lippi et al., 2019)
106
  - `pinc` = Privacy included: This tag identifies *"clauses stating that consumers consent to the privacy policy simply by using the service. Such clauses have been always considered potentially unfair"* (Drawzeski et al., 2021)
107
+ - `all_topics` = an aggregate column containing all applicable topics combined
108
 
109
  *”We assumed that each type of clause could be classified as either clearly fair, or potentially unfair, or clearly unfair. In order to mark the different degrees of (un)fairness we appended a numeric value to each XML tag, with 1 meaning clearly fair, 2 potentially unfair, and 3 clearly unfair. Nested tags were used to annotate text segments relevant to more than one type of clause. With clauses covering multiple paragraphs, we chose to tag each paragraph separately, possibly with different degrees of (un)fairness.”* (Lippi et al., 2019)
110
 
convert_to_hf_dataset.py CHANGED
@@ -6,8 +6,8 @@ import pandas as pd
6
 
7
  data_path = Path("corpus_NLLP2021")
8
  languages = ["de", "en", "it", "pl"]
9
- clause_topics = ["a", "ch", "cr", "j", "law", "ltd", "ter", "use", "pinc"]
10
  unfairness_levels = {1: "clearly_fair", 2: "potentially_unfair", 3: "clearly_unfair", -1: "untagged"}
 
11
 
12
  file_names = glob.glob(str(data_path / "sentences" / "de" / "original/*"))
13
  companies = sorted([Path(file_name).stem for file_name in file_names])
@@ -55,6 +55,17 @@ df = read_companies(languages, companies)
55
 
56
  df.to_csv("dataset.csv")
57
 
 
 
 
 
 
 
 
 
 
 
 
58
  # not removing sentences with no tag ==> detecting whether a tag at all applies is part of the task
59
  # print(len(df.index))
60
  # df = df[df.tag != ("",)]
6
 
7
  data_path = Path("corpus_NLLP2021")
8
  languages = ["de", "en", "it", "pl"]
 
9
  unfairness_levels = {1: "clearly_fair", 2: "potentially_unfair", 3: "clearly_unfair", -1: "untagged"}
10
+ clause_topics = ["a", "ch", "cr", "j", "law", "ltd", "ter", "use", "pinc"]
11
 
12
  file_names = glob.glob(str(data_path / "sentences" / "de" / "original/*"))
13
  companies = sorted([Path(file_name).stem for file_name in file_names])
55
 
56
  df.to_csv("dataset.csv")
57
 
58
+
59
+ def aggregate_topics(row):
60
+ all_topics = []
61
+ for clause_topic in clause_topics:
62
+ if row[clause_topic]:
63
+ all_topics.append(clause_topic)
64
+ return all_topics
65
+
66
+
67
+ df["all_topics"] = df.apply(aggregate_topics, axis=1)
68
+
69
  # not removing sentences with no tag ==> detecting whether a tag at all applies is part of the task
70
  # print(len(df.index))
71
  # df = df[df.tag != ("",)]
test.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe0c1f60d997211c6955e99d6ed8aa2f424d1da90d0db7026009de487ba9c87d
3
- size 1546605
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4471ea8b4293934013a7206fa16236cbe3a656e3807efa23e6d9ced690007cf
3
+ size 1617521
train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:85572547217470cd955952b3081ccf66968eca5e18d5bee273ffa4677eeb4c49
3
- size 7092520
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:777ad1e116aa18cfd46c60579eb1c5dddfef9bf1dc85cc23615187d9912012c7
3
+ size 7422250
validation.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:127c1edcc8aa66b05eec523564518249da52f0a41364512eb3d6321a5c9f7644
3
- size 620888
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f8e72b8b3125b1cd167030f0b4a8db17c87e53ecb5eeb6c227711608532b57b
3
+ size 648908