Datasets:

Modalities:
Text
Formats:
parquet
Languages:
Hindi
Libraries:
Datasets
pandas
License:
albertvillanova HF staff commited on
Commit
bca982b
1 Parent(s): ff897a1

Convert dataset to Parquet (#3)

Browse files

- Convert dataset to Parquet (d4fcd4f30bf416527f3cbbe18fd0350e9f2aefef)
- Delete loading script (199add7c2a857fd03ce6a7768fed382d2bcf44b8)
- Delete legacy dataset_infos.json (e2d2ddd86964dd6a01ed25bfb855254abbecffab)

README.md CHANGED
@@ -19,6 +19,7 @@ task_ids:
19
  - natural-language-inference
20
  pretty_name: BBC Hindi NLI Dataset
21
  dataset_info:
 
22
  features:
23
  - name: premise
24
  dtype: string
@@ -40,19 +41,28 @@ dataset_info:
40
  '3': entertainment
41
  '4': sport
42
  '5': science
43
- config_name: bbc hindi nli
44
  splits:
45
  - name: train
46
- num_bytes: 2990080
47
  num_examples: 15552
48
  - name: validation
49
- num_bytes: 496808
50
  num_examples: 2580
51
  - name: test
52
- num_bytes: 494432
53
  num_examples: 2592
54
- download_size: 3815652
55
- dataset_size: 3981320
 
 
 
 
 
 
 
 
 
 
56
  ---
57
 
58
  # Dataset Card for BBC Hindi NLI Dataset
 
19
  - natural-language-inference
20
  pretty_name: BBC Hindi NLI Dataset
21
  dataset_info:
22
+ config_name: bbc hindi nli
23
  features:
24
  - name: premise
25
  dtype: string
 
41
  '3': entertainment
42
  '4': sport
43
  '5': science
 
44
  splits:
45
  - name: train
46
+ num_bytes: 2990064
47
  num_examples: 15552
48
  - name: validation
49
+ num_bytes: 496800
50
  num_examples: 2580
51
  - name: test
52
+ num_bytes: 494424
53
  num_examples: 2592
54
+ download_size: 309124
55
+ dataset_size: 3981288
56
+ configs:
57
+ - config_name: bbc hindi nli
58
+ data_files:
59
+ - split: train
60
+ path: bbc hindi nli/train-*
61
+ - split: validation
62
+ path: bbc hindi nli/validation-*
63
+ - split: test
64
+ path: bbc hindi nli/test-*
65
+ default: true
66
  ---
67
 
68
  # Dataset Card for BBC Hindi NLI Dataset
bbc hindi nli/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12935e326819585d295f9296717c8afb1d08fa972cf29b21aa130ed286d3925f
3
+ size 21510
bbc hindi nli/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:050408cef4d788331cc6d4410afcaa014d302a826f8cfc3218c8ac0576c3902e
3
+ size 265927
bbc hindi nli/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7439c64280960dc7e82754fddc57dc3fe5b58435aa59408f50874f7a3a9bc9ca
3
+ size 21687
bbc_hindi_nli.py DELETED
@@ -1,160 +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
- """TODO: Add a description here."""
16
-
17
-
18
- import csv
19
-
20
- import datasets
21
-
22
-
23
- # TODO: Add BibTeX citation
24
- # Find for instance the citation on arxiv or on the dataset repo/website
25
- _CITATION = """\
26
- @inproceedings{uppal-etal-2020-two,
27
- title = "Two-Step Classification using Recasted Data for Low Resource Settings",
28
- author = "Uppal, Shagun and
29
- Gupta, Vivek and
30
- Swaminathan, Avinash and
31
- Zhang, Haimin and
32
- Mahata, Debanjan and
33
- Gosangi, Rakesh and
34
- Shah, Rajiv Ratn and
35
- Stent, Amanda",
36
- booktitle = "Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing",
37
- month = dec,
38
- year = "2020",
39
- address = "Suzhou, China",
40
- publisher = "Association for Computational Linguistics",
41
- url = "https://www.aclweb.org/anthology/2020.aacl-main.71",
42
- pages = "706--719",
43
- abstract = "An NLP model{'}s ability to reason should be independent of language. Previous works utilize Natural Language Inference (NLI) to understand the reasoning ability of models, mostly focusing on high resource languages like English. To address scarcity of data in low-resource languages such as Hindi, we use data recasting to create NLI datasets for four existing text classification datasets. Through experiments, we show that our recasted dataset is devoid of statistical irregularities and spurious patterns. We further study the consistency in predictions of the textual entailment models and propose a consistency regulariser to remove pairwise-inconsistencies in predictions. We propose a novel two-step classification method which uses textual-entailment predictions for classification task. We further improve the performance by using a joint-objective for classification and textual entailment. We therefore highlight the benefits of data recasting and improvements on classification performance using our approach with supporting experimental results.",
44
- }
45
- """
46
-
47
- # TODO: Add description of the dataset here
48
- # You can copy an official description
49
- _DESCRIPTION = """\
50
- This dataset is used to train models for Natural Language Inference Tasks in Low-Resource Languages like Hindi.
51
- """
52
-
53
- # TODO: Add a link to an official homepage for the dataset here
54
- _HOMEPAGE = "https://github.com/avinsit123/hindi-nli-data"
55
-
56
- # TODO: Add the licence for the dataset here if you can find it
57
- _LICENSE = """
58
- MIT License
59
-
60
- Copyright (c) 2019 MIDAS, IIIT Delhi
61
-
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
-
69
- The above copyright notice and this permission notice shall be included in all
70
- copies or substantial portions of the Software.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78
- SOFTWARE.
79
- """
80
-
81
- _TRAIN_DOWNLOAD_URL = (
82
- "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_train.tsv"
83
- )
84
- _VALID_DOWNLOAD_URL = (
85
- "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_dev.tsv"
86
- )
87
- _TEST_DOWNLOAD_URL = (
88
- "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_test.tsv"
89
- )
90
-
91
-
92
- class BbcHindiNLIConfig(datasets.BuilderConfig):
93
- """BuilderConfig for BBC Hindi NLI Config"""
94
-
95
- def __init__(self, **kwargs):
96
- """BuilderConfig for BBC Hindi NLI Config.
97
- Args:
98
- **kwargs: keyword arguments forwarded to super.
99
- """
100
- super(BbcHindiNLIConfig, self).__init__(**kwargs)
101
-
102
-
103
- class BbcHindiNLI(datasets.GeneratorBasedBuilder):
104
- """BBC Hindi NLI dataset -- Dataset providing textual-entailment pairs for NLI tasks in Hindi"""
105
-
106
- BUILDER_CONFIGS = [
107
- BbcHindiNLIConfig(
108
- name="bbc hindi nli",
109
- version=datasets.Version("1.1.0"),
110
- description="BBC Hindi NLI: Natural Language Inference Dataset in Hindi",
111
- ),
112
- ]
113
-
114
- def _info(self):
115
-
116
- return datasets.DatasetInfo(
117
- description=_DESCRIPTION,
118
- features=datasets.Features(
119
- {
120
- "premise": datasets.Value("string"),
121
- "hypothesis": datasets.Value("string"),
122
- "label": datasets.ClassLabel(names=["not-entailment", "entailment"]),
123
- "topic": datasets.ClassLabel(
124
- names=["india", "news", "international", "entertainment", "sport", "science"]
125
- ),
126
- }
127
- ),
128
- supervised_keys=None,
129
- homepage=_HOMEPAGE,
130
- license=_LICENSE,
131
- citation=_CITATION,
132
- )
133
-
134
- def _split_generators(self, dl_manager):
135
- """Returns SplitGenerators."""
136
- train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
137
- test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
138
- valid_path = dl_manager.download_and_extract(_VALID_DOWNLOAD_URL)
139
-
140
- return [
141
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
142
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": valid_path}),
143
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
144
- ]
145
-
146
- def _generate_examples(self, filepath):
147
- """Yields examples."""
148
-
149
- with open(filepath, encoding="utf-8") as tsv_file:
150
- tsv_reader = csv.reader(tsv_file, delimiter="\t")
151
- for id_, row in enumerate(tsv_reader):
152
- if id_ == 0:
153
- continue
154
- (premise, hypothesis, label, topic) = row
155
- yield id_, {
156
- "premise": premise,
157
- "hypothesis": hypothesis,
158
- "label": 1 if label == "entailed" else 0,
159
- "topic": int(topic),
160
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"bbc hindi nli": {"description": "This dataset is used to train models for Natural Language Inference Tasks in Low-Resource Languages like Hindi.\n", "citation": " @inproceedings{uppal-etal-2020-two,\n title = \"Two-Step Classification using Recasted Data for Low Resource Settings\",\n author = \"Uppal, Shagun and\n Gupta, Vivek and\n Swaminathan, Avinash and\n Zhang, Haimin and\n Mahata, Debanjan and\n Gosangi, Rakesh and\n Shah, Rajiv Ratn and\n Stent, Amanda\",\n booktitle = \"Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing\",\n month = dec,\n year = \"2020\",\n address = \"Suzhou, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.aacl-main.71\",\n pages = \"706--719\",\n abstract = \"An NLP model{'}s ability to reason should be independent of language. Previous works utilize Natural Language Inference (NLI) to understand the reasoning ability of models, mostly focusing on high resource languages like English. To address scarcity of data in low-resource languages such as Hindi, we use data recasting to create NLI datasets for four existing text classification datasets. Through experiments, we show that our recasted dataset is devoid of statistical irregularities and spurious patterns. We further study the consistency in predictions of the textual entailment models and propose a consistency regulariser to remove pairwise-inconsistencies in predictions. We propose a novel two-step classification method which uses textual-entailment predictions for classification task. We further improve the performance by using a joint-objective for classification and textual entailment. We therefore highlight the benefits of data recasting and improvements on classification performance using our approach with supporting experimental results.\",\n}\n", "homepage": "https://github.com/avinsit123/hindi-nli-data", "license": "\nMIT License\n\nCopyright (c) 2019 MIDAS, IIIT Delhi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "features": {"premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["not-entailment", "entailment"], "names_file": null, "id": null, "_type": "ClassLabel"}, "topic": {"num_classes": 6, "names": ["india", "news", "international", "entertainment", "sport", "science"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "bbc_hindi_nli", "config_name": "bbc hindi nli", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2990080, "num_examples": 15552, "dataset_name": "bbc_hindi_nli"}, "validation": {"name": "validation", "num_bytes": 496808, "num_examples": 2580, "dataset_name": "bbc_hindi_nli"}, "test": {"name": "test", "num_bytes": 494432, "num_examples": 2592, "dataset_name": "bbc_hindi_nli"}}, "download_checksums": {"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_train.tsv": {"num_bytes": 2865740, "checksum": "35aa4408b87d6a4bc9a896a1244598619ef95944f200f09dc1b67517a6f7caa6"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_test.tsv": {"num_bytes": 473720, "checksum": "9dd74eed0546156c7d9dfca6eed90419c34d09b2968166d1c5c4130f2606b598"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_dev.tsv": {"num_bytes": 476192, "checksum": "37fabb5b29319db5189d9e201b9510d8febf29cfb5fd0e1dae1b9841b6b268b0"}}, "download_size": 3815652, "post_processing_size": null, "dataset_size": 3981320, "size_in_bytes": 7796972}}