Datasets:

Languages:
Hindi
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
found
Annotations Creators:
machine-generated
Tags:
License:
system HF staff commited on
Commit
34be922
0 Parent(s):

Update files from the datasets library (from 1.3.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.3.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
README.md ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - machine-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - hi
8
+ licenses:
9
+ - mit
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - extended|hindi_discourse
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - natural-language-inference
20
+ ---
21
+
22
+ # Dataset Card for Hindi Discourse Analysis Dataset
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-fields)
32
+ - [Data Splits](#data-splits)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+ - [Contributions](#contributions)
47
+
48
+ ## Dataset Description
49
+
50
+ - **HomePage:** [GitHub](https://github.com/midas-research/hindi-nli-data)
51
+ - **Paper:** [Aclweb](https://www.aclweb.org/anthology/2020.aacl-main.71)
52
+ - **Point of Contact:** [GitHub](https://github.com/midas-research/hindi-nli-data)
53
+
54
+ ### Dataset Summary
55
+
56
+ - Dataset for Natural Language Inference in Hindi Language. Hindi Discourse Analysis (HDA) Dataset consists of textual-entailment pairs.
57
+ - Each row of the Datasets if made up of 4 columns - Premise, Hypothesis, Label and Topic.
58
+ - Premise and Hypothesis is written in Hindi while Entailment_Label is in English.
59
+ - Entailment_label is of 2 types - entailed and not-entailed.
60
+ - Entailed means that hypotheis can be inferred from premise and not-entailed means vice versa
61
+ - Dataset can be used to train models for Natural Language Inference tasks in Hindi Language.
62
+
63
+ ### Supported Tasks and Leaderboards
64
+
65
+ - Natural Language Inference for Hindi
66
+
67
+ ### Languages
68
+
69
+ - Dataset is in Hindi
70
+
71
+ ## Dataset Structure
72
+
73
+ - Data is structured in TSV format.
74
+ - train, test and dev files are in seperate files
75
+
76
+
77
+ ### Dataset Instances
78
+
79
+ An example of 'train' looks as follows.
80
+
81
+ ```
82
+ {'hypothesis': 'यह एक वर्णनात्मक कथन है।', 'label': 1, 'premise': 'जैसे उस का सारा चेहरा अपना हो और आँखें किसी दूसरे की जो चेहरे पर पपोटों के पीछे महसूर कर दी गईं।', 'topic': 1}
83
+
84
+
85
+ ```
86
+ ### Data Fields
87
+
88
+ Each row contatins 4 columns:
89
+ - premise: string
90
+ - hypothesis: string
91
+ - label: class label with values that correspond to "not-entailment" (0) or "entailment" (1)
92
+ - topic: class label with values that correspond to "Argumentative" (0), "Descriptive" (1), "Dialogic" (2), "Informative" (3) or "Narrative" (4).
93
+
94
+ ### Data Splits
95
+
96
+ - Train : 31892
97
+ - Valid : 9460
98
+ - Test : 9970
99
+
100
+ ## Dataset Creation
101
+
102
+ - We employ a recasting technique from Poliak et al. (2018a,b) to convert publicly available Hindi Discourse Analysis classification datasets in Hindi and pose them as TE problems
103
+ - In this recasting process, we build template hypotheses for each class in the label taxonomy
104
+ - Then, we pair the original annotated sentence with each of the template hypotheses to create TE samples.
105
+ - For more information on the recasting process, refer to paper https://www.aclweb.org/anthology/2020.aacl-main.71
106
+
107
+ ### Source Data
108
+
109
+ Source Dataset for the recasting process is the BBC Hindi Headlines Dataset(https://github.com/NirantK/hindi2vec/releases/tag/bbc-hindi-v0.1)
110
+
111
+ #### Initial Data Collection and Normalization
112
+
113
+ - Initial Data was collected by members of MIDAS Lab from Hindi Websites. They crowd sourced the data annotation process and selected two random stories from our corpus and had the three annotators work on them independently and classify each sentence based on the discourse mode.
114
+ - Please refer to this paper for detailed information: https://www.aclweb.org/anthology/2020.lrec-1.149/
115
+ - The Discourse is further classified into "Argumentative" , "Descriptive" , "Dialogic" , "Informative" and "Narrative" - 5 Clases.
116
+
117
+ #### Who are the source language producers?
118
+
119
+ Please refer to this paper for detailed information: https://www.aclweb.org/anthology/2020.lrec-1.149/
120
+
121
+ ### Annotations
122
+
123
+ #### Annotation process
124
+
125
+ Annotation process has been described in Dataset Creation Section.
126
+
127
+ #### Who are the annotators?
128
+
129
+ Annotation is done automatically by machine and corresponding recasting process.
130
+
131
+ ### Personal and Sensitive Information
132
+
133
+ No Personal and Sensitive Information is mentioned in the Datasets.
134
+
135
+ ## Considerations for Using the Data
136
+
137
+ Pls refer to this paper: https://www.aclweb.org/anthology/2020.aacl-main.71
138
+
139
+ ### Discussion of Biases
140
+
141
+ No known bias exist in the dataset.
142
+ Pls refer to this paper: https://www.aclweb.org/anthology/2020.aacl-main.71
143
+
144
+ ### Other Known Limitations
145
+
146
+ No other known limitations . Size of data may not be enough to train large models
147
+
148
+ ## Additional Information
149
+
150
+ Pls refer to this link: https://github.com/midas-research/hindi-nli-data
151
+
152
+ ### Dataset Curators
153
+
154
+ It is written in the repo : https://github.com/midas-research/hindi-nli-data that
155
+ - This corpus can be used freely for research purposes.
156
+ - The paper listed below provide details of the creation and use of the corpus. If you use the corpus, then please cite the paper.
157
+ - If interested in commercial use of the corpus, send email to midas@iiitd.ac.in.
158
+ - If you use the corpus in a product or application, then please credit the authors and Multimodal Digital Media Analysis Lab - Indraprastha Institute of Information Technology, New Delhi appropriately. Also, if you send us an email, we will be thrilled to know about how you have used the corpus.
159
+ - Multimodal Digital Media Analysis Lab - Indraprastha Institute of Information Technology, New Delhi, India disclaims any responsibility for the use of the corpus and does not provide technical support. However, the contact listed above will be happy to respond to queries and clarifications.
160
+ - Rather than redistributing the corpus, please direct interested parties to this page
161
+ - Please feel free to send us an email:
162
+ - with feedback regarding the corpus.
163
+ - with information on how you have used the corpus.
164
+ - if interested in having us analyze your data for natural language inference.
165
+ - if interested in a collaborative research project.
166
+
167
+
168
+ ### Licensing Information
169
+
170
+ Copyright (C) 2019 Multimodal Digital Media Analysis Lab - Indraprastha Institute of Information Technology, New Delhi (MIDAS, IIIT-Delhi).
171
+ Pls contact authors for any information on the dataset.
172
+
173
+ ### Citation Information
174
+
175
+ ```
176
+ @inproceedings{uppal-etal-2020-two,
177
+ title = "Two-Step Classification using Recasted Data for Low Resource Settings",
178
+ author = "Uppal, Shagun and
179
+ Gupta, Vivek and
180
+ Swaminathan, Avinash and
181
+ Zhang, Haimin and
182
+ Mahata, Debanjan and
183
+ Gosangi, Rakesh and
184
+ Shah, Rajiv Ratn and
185
+ Stent, Amanda",
186
+ 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",
187
+ month = dec,
188
+ year = "2020",
189
+ address = "Suzhou, China",
190
+ publisher = "Association for Computational Linguistics",
191
+ url = "https://www.aclweb.org/anthology/2020.aacl-main.71",
192
+ pages = "706--719",
193
+ 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.",
194
+ }
195
+ ```
196
+
197
+ ### Contributions
198
+
199
+ Thanks to [@avinsit123](https://github.com/avinsit123) for adding this dataset.
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"HDA hindi nli": {"description": "This dataset is a recasted version of the Hindi Discourse Analysis Dataset 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/midas-research/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": 5, "names": ["Argumentative", "Descriptive", "Dialogic", "Informative", "Narrative"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hda_nli_hindi", "config_name": "HDA hindi nli", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8721972, "num_examples": 31892, "dataset_name": "hda_nli_hindi"}, "validation": {"name": "validation", "num_bytes": 2556118, "num_examples": 9460, "dataset_name": "hda_nli_hindi"}, "test": {"name": "test", "num_bytes": 2646453, "num_examples": 9970, "dataset_name": "hda_nli_hindi"}}, "download_checksums": {"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_train.tsv": {"num_bytes": 8470892, "checksum": "4a8937f25005269f8ad513d0ae91d1140180e6c142e439282b56b1a0af7960eb"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_test.tsv": {"num_bytes": 2567907, "checksum": "f36a316eccc969c0fce3d66805acbd44dffdf46aa4f6babcd23b52a013ea83ca"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_dev.tsv": {"num_bytes": 2480462, "checksum": "e43af6693d236600db111f03dfb7cbef06b4acdf1ec49129e04556590b171fdf"}}, "download_size": 13519261, "post_processing_size": null, "dataset_size": 13924543, "size_in_bytes": 27443804}, "hda nli hindi": {"description": "This dataset is a recasted version of the Hindi Discourse Analysis Dataset 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/midas-research/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": 5, "names": ["Argumentative", "Descriptive", "Dialogic", "Informative", "Narrative"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hda_nli_hindi", "config_name": "hda nli hindi", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8721972, "num_examples": 31892, "dataset_name": "hda_nli_hindi"}, "validation": {"name": "validation", "num_bytes": 2556118, "num_examples": 9460, "dataset_name": "hda_nli_hindi"}, "test": {"name": "test", "num_bytes": 2646453, "num_examples": 9970, "dataset_name": "hda_nli_hindi"}}, "download_checksums": {"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_train.tsv": {"num_bytes": 8470892, "checksum": "4a8937f25005269f8ad513d0ae91d1140180e6c142e439282b56b1a0af7960eb"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_test.tsv": {"num_bytes": 2567907, "checksum": "f36a316eccc969c0fce3d66805acbd44dffdf46aa4f6babcd23b52a013ea83ca"}, "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_dev.tsv": {"num_bytes": 2480462, "checksum": "e43af6693d236600db111f03dfb7cbef06b4acdf1ec49129e04556590b171fdf"}}, "download_size": 13519261, "post_processing_size": null, "dataset_size": 13924543, "size_in_bytes": 27443804}}
dummy/HDA nli hindi/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a6cfd88f242b72e29af2efc183624f1e5aff58651ef9ed653eac18a83677c54
3
+ size 4407
hda_nli_hindi.py ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
16
+ from __future__ import absolute_import, division, print_function
17
+
18
+ import csv
19
+
20
+ import datasets
21
+
22
+
23
+ _CITATION = """\
24
+ @inproceedings{uppal-etal-2020-two,
25
+ title = "Two-Step Classification using Recasted Data for Low Resource Settings",
26
+ author = "Uppal, Shagun and
27
+ Gupta, Vivek and
28
+ Swaminathan, Avinash and
29
+ Zhang, Haimin and
30
+ Mahata, Debanjan and
31
+ Gosangi, Rakesh and
32
+ Shah, Rajiv Ratn and
33
+ Stent, Amanda",
34
+ 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",
35
+ month = dec,
36
+ year = "2020",
37
+ address = "Suzhou, China",
38
+ publisher = "Association for Computational Linguistics",
39
+ url = "https://www.aclweb.org/anthology/2020.aacl-main.71",
40
+ pages = "706--719",
41
+ 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.",
42
+ }
43
+ """
44
+
45
+ _DESCRIPTION = """\
46
+ This dataset is a recasted version of the Hindi Discourse Analysis Dataset used to train models for Natural Language Inference Tasks in Low-Resource Languages like Hindi.
47
+ """
48
+
49
+ _HOMEPAGE = "https://github.com/midas-research/hindi-nli-data"
50
+
51
+ _LICENSE = """
52
+ MIT License
53
+
54
+ Copyright (c) 2019 MIDAS, IIIT Delhi
55
+
56
+ Permission is hereby granted, free of charge, to any person obtaining a copy
57
+ of this software and associated documentation files (the "Software"), to deal
58
+ in the Software without restriction, including without limitation the rights
59
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
60
+ copies of the Software, and to permit persons to whom the Software is
61
+ furnished to do so, subject to the following conditions:
62
+
63
+ The above copyright notice and this permission notice shall be included in all
64
+ copies or substantial portions of the Software.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
69
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
70
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
71
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
72
+ SOFTWARE.
73
+ """
74
+
75
+ _TRAIN_DOWNLOAD_URL = (
76
+ "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_train.tsv"
77
+ )
78
+ _VALID_DOWNLOAD_URL = (
79
+ "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_dev.tsv"
80
+ )
81
+ _TEST_DOWNLOAD_URL = (
82
+ "https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/HDA/HDA_recasted_test.tsv"
83
+ )
84
+
85
+
86
+ class HdaNliHindiConfig(datasets.BuilderConfig):
87
+ """BuilderConfig for HDA NLI Hindi Config"""
88
+
89
+ def __init__(self, **kwargs):
90
+ """BuilderConfig for HDA NLI Hindi Config
91
+ Args:
92
+ **kwargs: keyword arguments forwarded to super.
93
+ """
94
+ super(HdaNliHindiConfig, self).__init__(**kwargs)
95
+
96
+
97
+ class HdaNliHindi(datasets.GeneratorBasedBuilder):
98
+ """HDA NLI Hindi dataset -- Dataset providing textual-entailment pairs for NLI tasks in Hindi"""
99
+
100
+ BUILDER_CONFIGS = [
101
+ HdaNliHindiConfig(
102
+ name="HDA nli hindi",
103
+ version=datasets.Version("1.1.0"),
104
+ description="HDA Hindi NLI: Natural Language Inference Dataset for Hindi Discourse Analysis in Hindi",
105
+ ),
106
+ ]
107
+
108
+ def _info(self):
109
+
110
+ return datasets.DatasetInfo(
111
+ description=_DESCRIPTION,
112
+ features=datasets.Features(
113
+ {
114
+ "premise": datasets.Value("string"),
115
+ "hypothesis": datasets.Value("string"),
116
+ "label": datasets.ClassLabel(names=["not-entailment", "entailment"]),
117
+ "topic": datasets.ClassLabel(
118
+ names=["Argumentative", "Descriptive", "Dialogic", "Informative", "Narrative"]
119
+ ),
120
+ }
121
+ ),
122
+ supervised_keys=None,
123
+ homepage=_HOMEPAGE,
124
+ license=_LICENSE,
125
+ citation=_CITATION,
126
+ )
127
+
128
+ def _split_generators(self, dl_manager):
129
+ """Returns SplitGenerators."""
130
+ train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
131
+ test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
132
+ valid_path = dl_manager.download_and_extract(_VALID_DOWNLOAD_URL)
133
+
134
+ return [
135
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
136
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": valid_path}),
137
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
138
+ ]
139
+
140
+ def _generate_examples(self, filepath):
141
+ """ Yields examples. """
142
+
143
+ with open(filepath, encoding="utf-8") as tsv_file:
144
+ tsv_reader = csv.reader(tsv_file, delimiter="\t")
145
+ for id_, row in enumerate(tsv_reader):
146
+ if id_ == 0:
147
+ continue
148
+ (premise, hypothesis, label, topic) = row
149
+ yield id_, {
150
+ "premise": premise,
151
+ "hypothesis": hypothesis,
152
+ "label": 1 if label == "entailed" else 0,
153
+ "topic": int(topic),
154
+ }