cakiki commited on
Commit
0fbd0d5
1 Parent(s): f598474

Initial commit

Browse files
Files changed (3) hide show
  1. .gitattributes +3 -0
  2. args-me.jsonl +3 -0
  3. args_me.py +115 -0
.gitattributes CHANGED
@@ -14,3 +14,6 @@
14
  *.pb filter=lfs diff=lfs merge=lfs -text
15
  *.pt filter=lfs diff=lfs merge=lfs -text
16
  *.pth filter=lfs diff=lfs merge=lfs -text
 
 
 
 
14
  *.pb filter=lfs diff=lfs merge=lfs -text
15
  *.pt filter=lfs diff=lfs merge=lfs -text
16
  *.pth filter=lfs diff=lfs merge=lfs -text
17
+ *.json filter=lfs diff=lfs merge=lfs -text
18
+ *.zip filter=lfs diff=lfs merge=lfs -text
19
+ *.jsonl filter=lfs diff=lfs merge=lfs -text
args-me.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc49ce6a5547370034be99365e8041d91ce477dbb4e0012ae16c0a6ecdd28187
3
+ size 886320113
args_me.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """args.me Dataset"""
16
+
17
+
18
+ import json
19
+
20
+ import datasets
21
+
22
+ _CITATION = """\
23
+ @dataset{yamen_ajjour_2020_4139439,
24
+ author = {Yamen Ajjour and
25
+ Henning Wachsmuth and
26
+ Johannes Kiesel and
27
+ Martin Potthast and
28
+ Matthias Hagen and
29
+ Benno Stein},
30
+ title = {args.me corpus},
31
+ month = oct,
32
+ year = 2020,
33
+ publisher = {Zenodo},
34
+ version = {1.0-cleaned},
35
+ doi = {10.5281/zenodo.4139439},
36
+ url = {https://doi.org/10.5281/zenodo.4139439}
37
+ }
38
+ """
39
+
40
+
41
+ _DESCRIPTION = """\
42
+ The args.me corpus (version 1.0, cleaned) comprises 382 545 arguments crawled from four debate portals in the middle of 2019. The debate portals are Debatewise, IDebate.org, Debatepedia, and Debate.org. The arguments are extracted using heuristics that are designed for each debate portal.
43
+ """
44
+
45
+ _HOMEPAGE = "https://zenodo.org/record/4139439"
46
+
47
+ _LICENSE = "https://creativecommons.org/licenses/by/4.0/legalcode"
48
+
49
+
50
+ _REPO = https://huggingface.co/datasets/cakiki/args.me/tree/main
51
+ _URLs = {
52
+ 'corpus': f"{_REPO}/args-me.jsonl",
53
+ 'topics': f"{_REPO}/topics.jsonl",
54
+ 'judgments': f"{_REPO}/judgments.jsonl"
55
+ }
56
+
57
+
58
+ class ArgsMe(datasets.GeneratorBasedBuilder):
59
+ """382,545 arguments crawled from debate portals"""
60
+
61
+ VERSION = datasets.Version("1.1.0")
62
+ BUILDER_CONFIGS = [
63
+ datasets.BuilderConfig(name="corpus", version=VERSION, description="The args.me dataset"),
64
+ datasets.BuilderConfig(name="topics", version=VERSION, description="The args.me dataset"),
65
+ datasets.BuilderConfig(name="judgments", version=VERSION, description="The args.me dataset"),
66
+ ]
67
+
68
+ DEFAULT_CONFIG_NAME = "corpus"
69
+
70
+ def _info(self):
71
+ features = datasets.Features(
72
+ {
73
+ "argument": datasets.Value("string"),
74
+ "conclusion": datasets.Value("string"),
75
+ "stance": datasets.Value("string"),
76
+ "id": datasets.Value("string")
77
+ }
78
+ )
79
+ return datasets.DatasetInfo(
80
+ description=_DESCRIPTION,
81
+ features=features,
82
+ supervised_keys=None,
83
+ homepage=_HOMEPAGE,
84
+ license=_LICENSE,
85
+ citation=_CITATION,
86
+ )
87
+
88
+ def _split_generators(self, dl_manager):
89
+ """Returns SplitGenerators."""
90
+ URL = _URLs[self.config.name]
91
+ data_file = dl_manager.download(URL)
92
+ return [
93
+ datasets.SplitGenerator(
94
+ name=datasets.Split.TRAIN,
95
+ gen_kwargs={
96
+ "data_file": data_file,
97
+ },
98
+ ),
99
+ ]
100
+
101
+ def _generate_examples(self, data_file):
102
+ """ Yields examples as (key, example) tuples. """
103
+
104
+
105
+ with open(data_file, encoding="utf-8") as f:
106
+ for row in f:
107
+ data = json.loads(row)
108
+ id_ = data['id']
109
+ content = data["premises"][0]
110
+ yield id_, {
111
+ "argument": content['text'],
112
+ "conclusion": data["conclusion"],
113
+ "stance": content['stance'],
114
+ "id": id_
115
+ }