albertvillanova HF staff commited on
Commit
322a349
1 Parent(s): 037e5d8

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (721454e4a9903136ddaae1c184149b8f850fd99f)
- Delete loading script (152bd834a789a6a2fed5871a3cb9f08688f2e98d)

README.md CHANGED
@@ -172,16 +172,25 @@ dataset_info:
172
  dtype: int64
173
  splits:
174
  - name: validation
175
- num_bytes: 254344
176
  num_examples: 21
177
  - name: train
178
- num_bytes: 2539778
179
  num_examples: 189
180
  - name: test
181
- num_bytes: 506191
182
  num_examples: 42
183
- download_size: 3208706
184
- dataset_size: 3300313
 
 
 
 
 
 
 
 
 
185
  ---
186
 
187
  # Dataset Card for HateOffensive
 
172
  dtype: int64
173
  splits:
174
  - name: validation
175
+ num_bytes: 254292
176
  num_examples: 21
177
  - name: train
178
+ num_bytes: 2539726
179
  num_examples: 189
180
  - name: test
181
+ num_bytes: 506139
182
  num_examples: 42
183
+ download_size: 1294604
184
+ dataset_size: 3300157
185
+ configs:
186
+ - config_name: default
187
+ data_files:
188
+ - split: validation
189
+ path: data/validation-*
190
+ - split: train
191
+ path: data/train-*
192
+ - split: test
193
+ path: data/test-*
194
  ---
195
 
196
  # Dataset Card for HateOffensive
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85982f6cae14f8fc599ecd5b991061fe6faf81a9c79a9835779ecdaf0426519b
3
+ size 205392
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98ff13a9f90ecf6f05470a0163d9a8157575f3ec7f98d1d4f7326cd995e80982
3
+ size 978897
data/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9313b900047f5e98cff0d2c1d13f0742f291d58e2ccbd09dfe0a39cf41eb056
3
+ size 110315
diplomacy_detection.py DELETED
@@ -1,183 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """Diplomacy: A Dataset for Deception Detection. It Takes Two to Lie: One to Lie, and One to Listen."""
16
-
17
-
18
- import json
19
- import os
20
-
21
- import datasets
22
-
23
-
24
- _CITATION = """
25
- @inproceedings{peskov-etal-2020-takes,
26
- title = "It Takes Two to Lie: One to Lie, and One to Listen",
27
- author = "Peskov, Denis and
28
- Cheng, Benny and
29
- Elgohary, Ahmed and
30
- Barrow, Joe and
31
- Danescu-Niculescu-Mizil, Cristian and
32
- Boyd-Graber, Jordan",
33
- booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
34
- month = jul,
35
- year = "2020",
36
- address = "Online",
37
- publisher = "Association for Computational Linguistics",
38
- url = "https://www.aclweb.org/anthology/2020.acl-main.353",
39
- doi = "10.18653/v1/2020.acl-main.353",
40
- pages = "3811--3854",
41
- abstract = "Trust is implicit in many online text conversations{---}striking up new friendships, or asking for tech support. But trust can be betrayed through deception. We study the language and dynamics of deception in the negotiation-based game Diplomacy, where seven players compete for world domination by forging and breaking alliances with each other. Our study with players from the Diplomacy community gathers 17,289 messages annotated by the sender for their intended truthfulness and by the receiver for their perceived truthfulness. Unlike existing datasets, this captures deception in long-lasting relationships, where the interlocutors strategically combine truth with lies to advance objectives. A model that uses power dynamics and conversational contexts can predict when a lie occurs nearly as well as human players.",
42
- }
43
- """
44
-
45
- _DESCRIPTION = "The Diplomacy dataset contains pairwise conversations annotated by the sender and the receiver for deception (and conversely truthfulness). The 17,289 messages are gathered from 12 games. "
46
-
47
- _HOMEPAGE = "https://sites.google.com/view/qanta/projects/diplomacy"
48
-
49
- # _LICENSE = ""
50
-
51
- _URL = "https://github.com/DenisPeskov/2020_acl_diplomacy/raw/master/data/"
52
-
53
- _PLAYABLE_COUNTRIES = ["italy", "turkey", "russia", "england", "austria", "germany", "france"]
54
- _SEASONS = ["spring", "fall", "winter", "Spring", "Fall", "Winter"]
55
- _YEARS = [
56
- "1901",
57
- "1902",
58
- "1903",
59
- "1904",
60
- "1905",
61
- "1906",
62
- "1907",
63
- "1908",
64
- "1909",
65
- "1910",
66
- "1911",
67
- "1912",
68
- "1913",
69
- "1914",
70
- "1915",
71
- "1916",
72
- "1917",
73
- "1918",
74
- ]
75
- _GAME_SCORE = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"]
76
- _GAME_SCORE_DELTA = [
77
- "0",
78
- "1",
79
- "2",
80
- "3",
81
- "4",
82
- "5",
83
- "6",
84
- "7",
85
- "8",
86
- "9",
87
- "10",
88
- "11",
89
- "12",
90
- "13",
91
- "14",
92
- "15",
93
- "16",
94
- "17",
95
- "18",
96
- "-1",
97
- "-2",
98
- "-3",
99
- "-4",
100
- "-5",
101
- "-6",
102
- "-7",
103
- "-8",
104
- "-9",
105
- "-10",
106
- "-11",
107
- "-12",
108
- "-13",
109
- "-14",
110
- "-15",
111
- "-16",
112
- "-17",
113
- "-18",
114
- ]
115
-
116
-
117
- class DiplomacyDetection(datasets.GeneratorBasedBuilder):
118
- """Diplomacy: A Dataset for Deception Detection."""
119
-
120
- VERSION = datasets.Version("1.1.0")
121
-
122
- def _info(self):
123
- features = datasets.Features(
124
- {
125
- "messages": datasets.Sequence(datasets.Value("string")),
126
- "sender_labels": datasets.Sequence(datasets.ClassLabel(names=["false", "true"])),
127
- "receiver_labels": datasets.Sequence(datasets.ClassLabel(names=["false", "true", "noannotation"])),
128
- "speakers": datasets.Sequence(datasets.ClassLabel(names=_PLAYABLE_COUNTRIES)),
129
- "receivers": datasets.Sequence(datasets.ClassLabel(names=_PLAYABLE_COUNTRIES)),
130
- "absolute_message_index": datasets.Sequence(datasets.Value("int64")),
131
- "relative_message_index": datasets.Sequence(datasets.Value("int64")),
132
- "seasons": datasets.Sequence(datasets.ClassLabel(names=_SEASONS)),
133
- "years": datasets.Sequence(datasets.ClassLabel(names=_YEARS)),
134
- "game_score": datasets.Sequence(datasets.ClassLabel(names=_GAME_SCORE)),
135
- "game_score_delta": datasets.Sequence(datasets.ClassLabel(names=_GAME_SCORE_DELTA)),
136
- "players": datasets.Sequence(datasets.ClassLabel(names=_PLAYABLE_COUNTRIES)),
137
- "game_id": datasets.Value("int64"),
138
- }
139
- )
140
- return datasets.DatasetInfo(
141
- description=_DESCRIPTION,
142
- features=features,
143
- supervised_keys=None,
144
- homepage=_HOMEPAGE,
145
- citation=_CITATION,
146
- )
147
-
148
- def _split_generators(self, dl_manager):
149
- """Returns SplitGenerators."""
150
- urls_to_download = {
151
- "train": os.path.join(_URL, "train.jsonl"),
152
- "test": os.path.join(_URL, "test.jsonl"),
153
- "validation": os.path.join(_URL, "validation.jsonl"),
154
- }
155
- downloaded_filepath = dl_manager.download(urls_to_download)
156
- return [
157
- datasets.SplitGenerator(
158
- name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_filepath["validation"]}
159
- ),
160
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_filepath["train"]}),
161
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_filepath["test"]}),
162
- ]
163
-
164
- def _generate_examples(self, filepath):
165
- """Yields examples."""
166
- with open(filepath, encoding="utf-8") as f:
167
- for id_, row in enumerate(f):
168
- data = json.loads(row)
169
- yield id_, {
170
- "messages": data["messages"],
171
- "sender_labels": [str(v).lower() for v in data["sender_labels"]],
172
- "receiver_labels": [str(v).lower() for v in data["receiver_labels"]],
173
- "speakers": data["speakers"],
174
- "receivers": data["receivers"],
175
- "absolute_message_index": data["absolute_message_index"],
176
- "relative_message_index": data["relative_message_index"],
177
- "seasons": data["seasons"],
178
- "years": data["years"],
179
- "game_score": data["game_score"],
180
- "game_score_delta": data["game_score_delta"],
181
- "players": data["players"],
182
- "game_id": data["game_id"],
183
- }