albertvillanova HF staff commited on
Commit
77f70b5
1 Parent(s): 52dc8b2

Convert dataset to Parquet (#1)

Browse files

- Convert dataset to Parquet (2f4bf07baf46ea58b07aa753a75ee9aeaf1ad8d2)
- Delete loading script (d489d2d1deeb78f99a00de3b46dacb5cceca4766)
- Delete legacy dataset_infos.json (96473eeaf59c7f530b4f6e3954a60de39ab420d2)

README.md CHANGED
@@ -17,9 +17,9 @@ task_categories:
17
  - text-classification
18
  task_ids:
19
  - intent-classification
20
- paperswithcode_id: null
21
  pretty_name: BingCoronavirusQuerySet
22
  dataset_info:
 
23
  features:
24
  - name: id
25
  dtype: int32
@@ -33,13 +33,18 @@ dataset_info:
33
  dtype: string
34
  - name: PopularityScore
35
  dtype: int32
36
- config_name: country_2020-09-01_2020-09-30
37
  splits:
38
  - name: train
39
- num_bytes: 22052706
40
  num_examples: 317856
41
- download_size: 16351450
42
- dataset_size: 22052706
 
 
 
 
 
 
43
  ---
44
 
45
  # Dataset Card for BingCoronavirusQuerySet
 
17
  - text-classification
18
  task_ids:
19
  - intent-classification
 
20
  pretty_name: BingCoronavirusQuerySet
21
  dataset_info:
22
+ config_name: country_2020-09-01_2020-09-30
23
  features:
24
  - name: id
25
  dtype: int32
 
33
  dtype: string
34
  - name: PopularityScore
35
  dtype: int32
 
36
  splits:
37
  - name: train
38
+ num_bytes: 22052194
39
  num_examples: 317856
40
+ download_size: 6768102
41
+ dataset_size: 22052194
42
+ configs:
43
+ - config_name: country_2020-09-01_2020-09-30
44
+ data_files:
45
+ - split: train
46
+ path: country_2020-09-01_2020-09-30/train-*
47
+ default: true
48
  ---
49
 
50
  # Dataset Card for BingCoronavirusQuerySet
bing_coronavirus_query_set.py DELETED
@@ -1,131 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 HuggingFace Datasets Authors.
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
-
16
- # Lint as: python3
17
-
18
- import datasets
19
-
20
-
21
- _DESCRIPTION = """\
22
- This dataset was curated from the Bing search logs (desktop users only) over the period of Jan 1st, 2020 – (Current Month - 1). Only searches that were issued many times by multiple users were included. The dataset includes queries from all over the world that had an intent related to the Coronavirus or Covid-19. In some cases this intent is explicit in the query itself (e.g., “Coronavirus updates Seattle”), in other cases it is implicit , e.g. “Shelter in place”. The implicit intent of search queries (e.g., “Toilet paper”) was extracted using random walks on the click graph as outlined in this paper by Microsoft Research. All personal data were removed.
23
- """
24
- _HOMEPAGE_URL = "https://github.com/microsoft/BingCoronavirusQuerySet"
25
- _CITATION = None
26
-
27
- _VERSION = "1.0.0"
28
- _BASE_URL = "https://raw.githubusercontent.com/microsoft/BingCoronavirusQuerySet/master/data/2020/{}_{}_{}.tsv"
29
-
30
-
31
- class BingCoronavirusQuerySetConfig(datasets.BuilderConfig):
32
- def __init__(self, *args, queries_by=None, start_date=None, end_date=None, **kwargs):
33
- super().__init__(
34
- *args,
35
- name=f"{queries_by}_{start_date}_{end_date}",
36
- **kwargs,
37
- )
38
- self.queries_by = queries_by
39
- self.start_date = start_date
40
- self.end_date = end_date
41
-
42
-
43
- class BingCoronavirusQuerySet(datasets.GeneratorBasedBuilder):
44
- BUILDER_CONFIGS = [
45
- BingCoronavirusQuerySetConfig(
46
- queries_by="country",
47
- start_date="2020-09-01",
48
- end_date="2020-09-30",
49
- description="Query by: country, start_date: 2020-09-01, end_date: 2020-09-30",
50
- version=datasets.Version(_VERSION),
51
- )
52
- ]
53
- BUILDER_CONFIG_CLASS = BingCoronavirusQuerySetConfig
54
-
55
- def _info(self):
56
- if self.config.queries_by == "country":
57
- features = datasets.Features(
58
- {
59
- "id": datasets.Value("int32"),
60
- "Date": datasets.Value("string"),
61
- "Query": datasets.Value("string"),
62
- "IsImplicitIntent": datasets.Value("string"),
63
- "Country": datasets.Value("string"),
64
- "PopularityScore": datasets.Value("int32"),
65
- },
66
- )
67
- elif self.config.queries_by == "state":
68
- features = datasets.Features(
69
- {
70
- "id": datasets.Value("int32"),
71
- "Date": datasets.Value("string"),
72
- "Query": datasets.Value("string"),
73
- "IsImplicitIntent": datasets.Value("string"),
74
- "State": datasets.Value("string"),
75
- "Country": datasets.Value("string"),
76
- "PopularityScore": datasets.Value("int32"),
77
- },
78
- )
79
- else:
80
- raise Exception("Unknown queries_by. Choose one of: country or state")
81
- return datasets.DatasetInfo(
82
- description=_DESCRIPTION,
83
- features=features,
84
- supervised_keys=None,
85
- homepage=_HOMEPAGE_URL,
86
- citation=_CITATION,
87
- )
88
-
89
- def _split_generators(self, dl_manager):
90
- def _base_url(queries_by, start_date, end_date):
91
- if queries_by == "country":
92
- queries_by = "QueriesByCountry"
93
- else:
94
- queries_by = "QueriesByState"
95
- return _BASE_URL.format(queries_by, start_date, end_date)
96
-
97
- download_url = _base_url(self.config.queries_by, self.config.start_date, self.config.end_date)
98
- path = dl_manager.download_and_extract(download_url)
99
- return [
100
- datasets.SplitGenerator(
101
- name=datasets.Split.TRAIN,
102
- gen_kwargs={"datapath": path},
103
- )
104
- ]
105
-
106
- def _generate_examples(self, datapath):
107
- with open(datapath, encoding="utf-8") as f:
108
- for sentence_counter, row in enumerate(f):
109
- if sentence_counter == 0:
110
- continue
111
- row = row.strip().split("\t")
112
- if self.config.queries_by == "country":
113
- resp = {
114
- "id": sentence_counter,
115
- "Date": row[0],
116
- "Query": row[1],
117
- "IsImplicitIntent": row[2],
118
- "Country": row[3],
119
- "PopularityScore": row[4],
120
- }
121
- else:
122
- resp = {
123
- "id": sentence_counter,
124
- "Date": row[0],
125
- "Query": row[1],
126
- "IsImplicitIntent": row[2],
127
- "State": row[3],
128
- "Country": row[4],
129
- "PopularityScore": int(row[5]),
130
- }
131
- yield sentence_counter, resp
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
country_2020-09-01_2020-09-30/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:caea2c4420516b33f8d1515bec0686702b94d2c74cdb2ccbd16104d9875e4ee6
3
+ size 6768102
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"country_2020-09-01_2020-09-30": {"description": "This dataset was curated from the Bing search logs (desktop users only) over the period of Jan 1st, 2020 \u2013 (Current Month - 1). Only searches that were issued many times by multiple users were included. The dataset includes queries from all over the world that had an intent related to the Coronavirus or Covid-19. In some cases this intent is explicit in the query itself (e.g., \u201cCoronavirus updates Seattle\u201d), in other cases it is implicit , e.g. \u201cShelter in place\u201d. The implicit intent of search queries (e.g., \u201cToilet paper\u201d) was extracted using random walks on the click graph as outlined in this paper by Microsoft Research. All personal data were removed.\n", "citation": "", "homepage": "https://github.com/microsoft/BingCoronavirusQuerySet", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "Date": {"dtype": "string", "id": null, "_type": "Value"}, "Query": {"dtype": "string", "id": null, "_type": "Value"}, "IsImplicitIntent": {"dtype": "string", "id": null, "_type": "Value"}, "Country": {"dtype": "string", "id": null, "_type": "Value"}, "PopularityScore": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "bing_coronavirus_query_set", "config_name": "country_2020-09-01_2020-09-30", "version": "0.0.0", "splits": {"train": {"name": "train", "num_bytes": 22052706, "num_examples": 317856, "dataset_name": "bing_coronavirus_query_set"}}, "download_checksums": {"https://raw.githubusercontent.com/microsoft/BingCoronavirusQuerySet/master/data/2020/QueriesByCountry_2020-09-01_2020-09-30.tsv": {"num_bytes": 16351450, "checksum": "ff0eac0790cd4a276cb83c74200d692b0b38b6dc36cfc93b513415aed3dc724b"}}, "download_size": 16351450, "post_processing_size": null, "dataset_size": 22052706, "size_in_bytes": 38404156}}