maximedb commited on
Commit
6079ffc
1 Parent(s): 4e3d16d

First version

Browse files
Files changed (6) hide show
  1. .gitattributes +2 -0
  2. 20Q.py +69 -0
  3. README.md +21 -0
  4. data/test.jsonl +3 -0
  5. data/train.jsonl +3 -0
  6. dataset_infos.json +1 -0
.gitattributes CHANGED
@@ -49,3 +49,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
49
  *.jpg filter=lfs diff=lfs merge=lfs -text
50
  *.jpeg filter=lfs diff=lfs merge=lfs -text
51
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
 
49
  *.jpg filter=lfs diff=lfs merge=lfs -text
50
  *.jpeg filter=lfs diff=lfs merge=lfs -text
51
  *.webp filter=lfs diff=lfs merge=lfs -text
52
+ data/test.jsonl filter=lfs diff=lfs merge=lfs -text
53
+ data/train.jsonl filter=lfs diff=lfs merge=lfs -text
20Q.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import datasets
4
+
5
+
6
+ # TODO: Add description of the dataset here
7
+ # You can copy an official description
8
+ _DESCRIPTION = """20Q"""
9
+
10
+ # TODO: Add a link to an official homepage for the dataset here
11
+ _HOMEPAGE = ""
12
+
13
+ # TODO: Add the licence for the dataset here if you can find it
14
+ _LICENSE = ""
15
+
16
+
17
+
18
+ class NewDataset(datasets.GeneratorBasedBuilder):
19
+ """TODO: Short description of my dataset."""
20
+
21
+ VERSION = datasets.Version("1.0.0")
22
+
23
+ def _info(self):
24
+ features = datasets.Features(
25
+ {
26
+ "subject": datasets.Value("string"),
27
+ "question": datasets.Value("string"),
28
+ "label": datasets.Value("bool"),
29
+ "label_fine_grained": datasets.Value("string")
30
+ }
31
+ )
32
+
33
+ return datasets.DatasetInfo(
34
+ description=_DESCRIPTION,
35
+ features=features,
36
+ homepage=_HOMEPAGE,
37
+ license=_LICENSE,
38
+ citation="_CITATION",
39
+ )
40
+
41
+ def _split_generators(self, dl_manager):
42
+ data_dir = dl_manager.download_and_extract(["data/train.jsonl", "data/test.jsonl"])
43
+ return [
44
+ datasets.SplitGenerator(
45
+ name=datasets.Split.TRAIN,
46
+ gen_kwargs={
47
+ "filepath": data_dir[0],
48
+ "split": "train",
49
+ },
50
+ ),
51
+ datasets.SplitGenerator(
52
+ name=datasets.Split.TEST,
53
+ gen_kwargs={
54
+ "filepath": data_dir[1],
55
+ "split": "test"
56
+ },
57
+ ),
58
+ ]
59
+
60
+ def _generate_examples(self, filepath, split):
61
+ with open(filepath, encoding="utf-8") as f:
62
+ for key, row in enumerate(f):
63
+ data = json.loads(row)
64
+ yield key, {
65
+ "subject": data["subject"],
66
+ "question": data["question"],
67
+ "label": data["label"],
68
+ "label_fine_grained": data["label_fine_grained"]
69
+ }
README.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ annotations_creators:
2
+ - crowdsourced
3
+ language:
4
+ - en
5
+ language_creators:
6
+ - other
7
+ license:
8
+ - cc-by-4.0
9
+ multilinguality:
10
+ - monolingual
11
+ pretty_name: 20Q
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets: []
15
+ tags:
16
+ - 20Q
17
+ - 20 Questions
18
+ - Twenty Questions
19
+ task_categories:
20
+ - question-answering
21
+ task_ids:
data/test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7988520fd212c07487b2a6ec55a3e498722c0c926120414492d45f2395a854bb
3
+ size 274029
data/train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e84b36b32ca487767a1a7852769e7d23446124ffb5874b5dd1152ecfc94a53f4
3
+ size 90784
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "20Q", "citation": "_CITATION", "homepage": "", "license": "", "features": {"subject": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "bool", "id": null, "_type": "Value"}, "label_fine_grained": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "new_dataset", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 40740, "num_examples": 815, "dataset_name": "new_dataset"}, "test": {"name": "test", "num_bytes": 120391, "num_examples": 2500, "dataset_name": "new_dataset"}}, "download_checksums": {"data/train.jsonl": {"num_bytes": 90784, "checksum": "e84b36b32ca487767a1a7852769e7d23446124ffb5874b5dd1152ecfc94a53f4"}, "data/test.jsonl": {"num_bytes": 274029, "checksum": "7988520fd212c07487b2a6ec55a3e498722c0c926120414492d45f2395a854bb"}}, "download_size": 364813, "post_processing_size": null, "dataset_size": 161131, "size_in_bytes": 525944}}