system HF staff commited on
Commit
740c950
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
coarse_discourse.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(coarse_discourse): Add a description here."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import json
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ # TODO(coarse_discourse): BibTeX citation
12
+ _CITATION = """\
13
+ @inproceedings{coarsediscourse, title={Characterizing Online Discussion Using Coarse Discourse Sequences}, author={Zhang, Amy X. and Culbertson, Bryan and Paritosh, Praveen}, booktitle={Proceedings of the 11th International AAAI Conference on Weblogs and Social Media}, series={ICWSM '17}, year={2017}, location = {Montreal, Canada} }
14
+ """
15
+
16
+ # TODO(coarse_discourse):
17
+ _DESCRIPTION = """\
18
+ dataset contains discourse annotation and relation on threads from reddit during 2016
19
+ """
20
+ _URL = "https://github.com/google-research-datasets/coarse-discourse/archive/master.zip"
21
+
22
+
23
+ class CoarseDiscourse(datasets.GeneratorBasedBuilder):
24
+ """TODO(coarse_discourse): Short description of my dataset."""
25
+
26
+ # TODO(coarse_discourse): Set up version.
27
+ VERSION = datasets.Version("0.1.0")
28
+
29
+ def _info(self):
30
+ # TODO(coarse_discourse): Specifies the datasets.DatasetInfo object
31
+ return datasets.DatasetInfo(
32
+ # This is the description that will appear on the datasets page.
33
+ description=_DESCRIPTION,
34
+ # datasets.features.FeatureConnectors
35
+ features=datasets.Features(
36
+ {
37
+ # These are the features of your dataset like images, labels ...
38
+ "title": datasets.Value("string"),
39
+ "is_self_post": datasets.Value("bool"),
40
+ "subreddit": datasets.Value("string"),
41
+ "url": datasets.Value("string"),
42
+ "majority_link": datasets.Value("string"),
43
+ "is_first_post": datasets.Value("bool"),
44
+ "majority_type": datasets.Value("string"),
45
+ "id_post": datasets.Value("string"),
46
+ "post_depth": datasets.Value("int32"),
47
+ "in_reply_to": datasets.Value("string"),
48
+ "annotations": datasets.features.Sequence(
49
+ {
50
+ "annotator": datasets.Value("string"),
51
+ "link_to_post": datasets.Value("string"),
52
+ "main_type": datasets.Value("string"),
53
+ }
54
+ ),
55
+ }
56
+ ),
57
+ # If there's a common (input, target) tuple from the features,
58
+ # specify them here. They'll be used if as_supervised=True in
59
+ # builder.as_dataset.
60
+ supervised_keys=None,
61
+ # Homepage of the dataset for documentation
62
+ homepage="https://github.com/google-research-datasets/coarse-discourse",
63
+ citation=_CITATION,
64
+ )
65
+
66
+ def _split_generators(self, dl_manager):
67
+ """Returns SplitGenerators."""
68
+ # TODO(coarse_discourse): Downloads the data and defines the splits
69
+ # dl_manager is a datasets.download.DownloadManager that can be used to
70
+ # download and extract URLs
71
+ dl_dir = dl_manager.download_and_extract(_URL)
72
+ return [
73
+ datasets.SplitGenerator(
74
+ name=datasets.Split.TRAIN,
75
+ # These kwargs will be passed to _generate_examples
76
+ gen_kwargs={
77
+ "filepath": os.path.join(dl_dir, "coarse-discourse-master", "coarse_discourse_dataset.json")
78
+ },
79
+ ),
80
+ ]
81
+
82
+ def _generate_examples(self, filepath):
83
+ """Yields examples."""
84
+ # TODO(coarse_discourse): Yields (key, example) tuples from the dataset
85
+ with open(filepath, encoding="utf-8") as f:
86
+ for id_, row in enumerate(f):
87
+ data = json.loads(row)
88
+ url = data.get("url", "")
89
+ is_self_post = data.get("is_self_post", "")
90
+ subreddit = data.get("subreddit", "")
91
+ title = data.get("title", "")
92
+ posts = data.get("posts", "")
93
+ for id1, post in enumerate(posts):
94
+ maj_link = post.get("majority_link", "")
95
+ maj_type = post.get("majority_type", "")
96
+ id_post = post.get("id", "")
97
+ is_first_post = post.get("is_firs_post", "")
98
+ post_depth = post.get("post_depth", -1)
99
+ in_reply_to = post.get("in_reply_to", "")
100
+ annotations = post["annotations"]
101
+ annotators = [annotation.get("annotator", "") for annotation in annotations]
102
+ main_types = [annotation.get("main_type", "") for annotation in annotations]
103
+ link_posts = [annotation.get("linkk_to_post", "") for annotation in annotations]
104
+
105
+ yield str(id_) + "_" + str(id1), {
106
+ "title": title,
107
+ "is_self_post": is_self_post,
108
+ "subreddit": subreddit,
109
+ "url": url,
110
+ "majority_link": maj_link,
111
+ "is_first_post": is_first_post,
112
+ "majority_type": maj_type,
113
+ "id_post": id_post,
114
+ "post_depth": post_depth,
115
+ "in_reply_to": in_reply_to,
116
+ "annotations": {"annotator": annotators, "link_to_post": link_posts, "main_type": main_types},
117
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "dataset contains discourse annotation and relation on threads from reddit during 2016\n", "citation": "@inproceedings{coarsediscourse, title={Characterizing Online Discussion Using Coarse Discourse Sequences}, author={Zhang, Amy X. and Culbertson, Bryan and Paritosh, Praveen}, booktitle={Proceedings of the 11th International AAAI Conference on Weblogs and Social Media}, series={ICWSM '17}, year={2017}, location = {Montreal, Canada} }\n", "homepage": "https://github.com/google-research-datasets/coarse-discourse", "license": "", "features": {"title": {"dtype": "string", "id": null, "_type": "Value"}, "is_self_post": {"dtype": "bool", "id": null, "_type": "Value"}, "subreddit": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "majority_link": {"dtype": "string", "id": null, "_type": "Value"}, "is_first_post": {"dtype": "bool", "id": null, "_type": "Value"}, "majority_type": {"dtype": "string", "id": null, "_type": "Value"}, "id_post": {"dtype": "string", "id": null, "_type": "Value"}, "post_depth": {"dtype": "int32", "id": null, "_type": "Value"}, "in_reply_to": {"dtype": "string", "id": null, "_type": "Value"}, "annotations": {"feature": {"annotator": {"dtype": "string", "id": null, "_type": "Value"}, "link_to_post": {"dtype": "string", "id": null, "_type": "Value"}, "main_type": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "supervised_keys": null, "builder_name": "coarse_discourse", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 45443464, "num_examples": 116357, "dataset_name": "coarse_discourse"}}, "download_checksums": {"https://github.com/google-research-datasets/coarse-discourse/archive/master.zip": {"num_bytes": 4636201, "checksum": "8e1e685c5907a6d654be8b8ed307522fd91ca919f503713fd1627fbe3d43c3cd"}}, "download_size": 4636201, "dataset_size": 45443464, "size_in_bytes": 50079665}}
dummy/0.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e3c0fcee52339651069d3a9189511cb4723eb7643836e64c9f0bf8fcc49b4db
3
+ size 1128