Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
natural-language-inference
Languages:
Hindi
Size:
10K - 100K
License:
Commit
•
8337f9f
0
Parent(s):
Update files from the datasets library (from 1.3.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.3.0
- .gitattributes +27 -0
- README.md +195 -0
- bbc_hindi_nli.py +161 -0
- dataset_infos.json +1 -0
- dummy/bbc hindi nli/1.1.0/dummy_data.zip +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,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|bbc__hindi_news_classification
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
task_ids:
|
19 |
+
- natural-language-inference
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for BBC Hindi NLI 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 |
+
- **Repository:** [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. BBC Hindi Dataset consists of textual-entailment pairs.
|
57 |
+
- Each row of the Datasets if made up of 4 columns - Premise, Hypothesis, Label and Topic.
|
58 |
+
- Context and Hypothesis is written in Hindi while Entailment_Label is in English.
|
59 |
+
- Entailment_label is of 2 types - entailed and not-entailed.
|
60 |
+
- Dataset can be used to train models for Natural Language Inference tasks in Hindi Language.
|
61 |
+
[More Information Needed]
|
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 and Test files are in seperate files
|
75 |
+
|
76 |
+
|
77 |
+
### Dataset Instances
|
78 |
+
|
79 |
+
An example of 'train' looks as follows.
|
80 |
+
|
81 |
+
```
|
82 |
+
{'hypothesis': 'यह खबर की सूचना है|', 'label': 'entailed', 'premise': 'गोपनीयता की नीति', 'topic': '1'}
|
83 |
+
|
84 |
+
```
|
85 |
+
### Data Fields
|
86 |
+
|
87 |
+
- Each row contatins 4 columns - Premise, Hypothesis, Label and Topic.
|
88 |
+
|
89 |
+
### Data Splits
|
90 |
+
|
91 |
+
- Train : 15553
|
92 |
+
- Valid : 2581
|
93 |
+
- Test : 2593
|
94 |
+
|
95 |
+
## Dataset Creation
|
96 |
+
|
97 |
+
- We employ a recasting technique from Poliak et al. (2018a,b) to convert publicly available BBC Hindi news text classification datasets in Hindi and pose them as TE problems
|
98 |
+
- In this recasting process, we build template hypotheses for each class in the label taxonomy
|
99 |
+
- Then, we pair the original annotated sentence with each of the template hypotheses to create TE samples.
|
100 |
+
- For more information on the recasting process, refer to paper "https://www.aclweb.org/anthology/2020.aacl-main.71"
|
101 |
+
|
102 |
+
### Source Data
|
103 |
+
|
104 |
+
Source Dataset for the recasting process is the BBC Hindi Headlines Dataset(https://github.com/NirantK/hindi2vec/releases/tag/bbc-hindi-v0.1)
|
105 |
+
|
106 |
+
#### Initial Data Collection and Normalization
|
107 |
+
|
108 |
+
- BBC Hindi News Classification Dataset contains 4, 335 Hindi news headlines tagged across 14 categories: India, Pakistan,news, International, entertainment, sport, science, China, learning english, social, southasia, business, institutional, multimedia
|
109 |
+
- We processed this dataset to combine two sets of relevant but low prevalence classes.
|
110 |
+
- Namely, we merged the samples from Pakistan, China, international, and southasia as one class called international.
|
111 |
+
- Likewise, we also merged samples from news, business, social, learning english, and institutional as news.
|
112 |
+
- Lastly, we also removed the class multimedia because there were very few samples.
|
113 |
+
|
114 |
+
#### Who are the source language producers?
|
115 |
+
|
116 |
+
Pls refer to this paper: "https://www.aclweb.org/anthology/2020.aacl-main.71"
|
117 |
+
|
118 |
+
### Annotations
|
119 |
+
|
120 |
+
#### Annotation process
|
121 |
+
|
122 |
+
Annotation process has been described in Dataset Creation Section.
|
123 |
+
|
124 |
+
#### Who are the annotators?
|
125 |
+
|
126 |
+
Annotation is done automatically.
|
127 |
+
|
128 |
+
### Personal and Sensitive Information
|
129 |
+
|
130 |
+
No Personal and Sensitive Information is mentioned in the Datasets.
|
131 |
+
|
132 |
+
## Considerations for Using the Data
|
133 |
+
|
134 |
+
Pls refer to this paper: https://www.aclweb.org/anthology/2020.aacl-main.71
|
135 |
+
|
136 |
+
### Discussion of Biases
|
137 |
+
|
138 |
+
Pls refer to this paper: https://www.aclweb.org/anthology/2020.aacl-main.71
|
139 |
+
|
140 |
+
### Other Known Limitations
|
141 |
+
|
142 |
+
No other known limitations
|
143 |
+
|
144 |
+
## Additional Information
|
145 |
+
|
146 |
+
Pls refer to this link: https://github.com/midas-research/hindi-nli-data
|
147 |
+
|
148 |
+
### Dataset Curators
|
149 |
+
|
150 |
+
It is written in the repo : https://github.com/avinsit123/hindi-nli-data that
|
151 |
+
- This corpus can be used freely for research purposes.
|
152 |
+
- The paper listed below provide details of the creation and use of the corpus. If you use the corpus, then please cite the paper.
|
153 |
+
- If interested in commercial use of the corpus, send email to midas@iiitd.ac.in.
|
154 |
+
- 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.
|
155 |
+
- 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.
|
156 |
+
- Rather than redistributing the corpus, please direct interested parties to this page
|
157 |
+
- Please feel free to send us an email:
|
158 |
+
- with feedback regarding the corpus.
|
159 |
+
- with information on how you have used the corpus.
|
160 |
+
- if interested in having us analyze your data for natural language inference.
|
161 |
+
- if interested in a collaborative research project.
|
162 |
+
|
163 |
+
|
164 |
+
### Licensing Information
|
165 |
+
|
166 |
+
Copyright (C) 2019 Multimodal Digital Media Analysis Lab - Indraprastha Institute of Information Technology, New Delhi (MIDAS, IIIT-Delhi).
|
167 |
+
Pls contact authors for any information on the dataset.
|
168 |
+
|
169 |
+
### Citation Information
|
170 |
+
|
171 |
+
```
|
172 |
+
@inproceedings{uppal-etal-2020-two,
|
173 |
+
title = "Two-Step Classification using Recasted Data for Low Resource Settings",
|
174 |
+
author = "Uppal, Shagun and
|
175 |
+
Gupta, Vivek and
|
176 |
+
Swaminathan, Avinash and
|
177 |
+
Zhang, Haimin and
|
178 |
+
Mahata, Debanjan and
|
179 |
+
Gosangi, Rakesh and
|
180 |
+
Shah, Rajiv Ratn and
|
181 |
+
Stent, Amanda",
|
182 |
+
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",
|
183 |
+
month = dec,
|
184 |
+
year = "2020",
|
185 |
+
address = "Suzhou, China",
|
186 |
+
publisher = "Association for Computational Linguistics",
|
187 |
+
url = "https://www.aclweb.org/anthology/2020.aacl-main.71",
|
188 |
+
pages = "706--719",
|
189 |
+
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.",
|
190 |
+
}
|
191 |
+
```
|
192 |
+
|
193 |
+
### Contributions
|
194 |
+
|
195 |
+
Thanks to [@avinsit123](https://github.com/avinsit123) for adding this dataset.
|
bbc_hindi_nli.py
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
# TODO: Add BibTeX citation
|
25 |
+
# Find for instance the citation on arxiv or on the dataset repo/website
|
26 |
+
_CITATION = """\
|
27 |
+
@inproceedings{uppal-etal-2020-two,
|
28 |
+
title = "Two-Step Classification using Recasted Data for Low Resource Settings",
|
29 |
+
author = "Uppal, Shagun and
|
30 |
+
Gupta, Vivek and
|
31 |
+
Swaminathan, Avinash and
|
32 |
+
Zhang, Haimin and
|
33 |
+
Mahata, Debanjan and
|
34 |
+
Gosangi, Rakesh and
|
35 |
+
Shah, Rajiv Ratn and
|
36 |
+
Stent, Amanda",
|
37 |
+
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",
|
38 |
+
month = dec,
|
39 |
+
year = "2020",
|
40 |
+
address = "Suzhou, China",
|
41 |
+
publisher = "Association for Computational Linguistics",
|
42 |
+
url = "https://www.aclweb.org/anthology/2020.aacl-main.71",
|
43 |
+
pages = "706--719",
|
44 |
+
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.",
|
45 |
+
}
|
46 |
+
"""
|
47 |
+
|
48 |
+
# TODO: Add description of the dataset here
|
49 |
+
# You can copy an official description
|
50 |
+
_DESCRIPTION = """\
|
51 |
+
This dataset is used to train models for Natural Language Inference Tasks in Low-Resource Languages like Hindi.
|
52 |
+
"""
|
53 |
+
|
54 |
+
# TODO: Add a link to an official homepage for the dataset here
|
55 |
+
_HOMEPAGE = "https://github.com/avinsit123/hindi-nli-data"
|
56 |
+
|
57 |
+
# TODO: Add the licence for the dataset here if you can find it
|
58 |
+
_LICENSE = """
|
59 |
+
MIT License
|
60 |
+
|
61 |
+
Copyright (c) 2019 MIDAS, IIIT Delhi
|
62 |
+
|
63 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
64 |
+
of this software and associated documentation files (the "Software"), to deal
|
65 |
+
in the Software without restriction, including without limitation the rights
|
66 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
67 |
+
copies of the Software, and to permit persons to whom the Software is
|
68 |
+
furnished to do so, subject to the following conditions:
|
69 |
+
|
70 |
+
The above copyright notice and this permission notice shall be included in all
|
71 |
+
copies or substantial portions of the Software.
|
72 |
+
|
73 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
74 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
75 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
76 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
77 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
78 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
79 |
+
SOFTWARE.
|
80 |
+
"""
|
81 |
+
|
82 |
+
_TRAIN_DOWNLOAD_URL = (
|
83 |
+
"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_train.tsv"
|
84 |
+
)
|
85 |
+
_VALID_DOWNLOAD_URL = (
|
86 |
+
"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_dev.tsv"
|
87 |
+
)
|
88 |
+
_TEST_DOWNLOAD_URL = (
|
89 |
+
"https://raw.githubusercontent.com/avinsit123/hindi-nli-data/master/Textual_Entailment/BBC/BBC_recasted_test.tsv"
|
90 |
+
)
|
91 |
+
|
92 |
+
|
93 |
+
class BbcHindiNLIConfig(datasets.BuilderConfig):
|
94 |
+
"""BuilderConfig for BBC Hindi NLI Config"""
|
95 |
+
|
96 |
+
def __init__(self, **kwargs):
|
97 |
+
"""BuilderConfig for BBC Hindi NLI Config.
|
98 |
+
Args:
|
99 |
+
**kwargs: keyword arguments forwarded to super.
|
100 |
+
"""
|
101 |
+
super(BbcHindiNLIConfig, self).__init__(**kwargs)
|
102 |
+
|
103 |
+
|
104 |
+
class BbcHindiNLI(datasets.GeneratorBasedBuilder):
|
105 |
+
"""BBC Hindi NLI dataset -- Dataset providing textual-entailment pairs for NLI tasks in Hindi"""
|
106 |
+
|
107 |
+
BUILDER_CONFIGS = [
|
108 |
+
BbcHindiNLIConfig(
|
109 |
+
name="bbc hindi nli",
|
110 |
+
version=datasets.Version("1.1.0"),
|
111 |
+
description="BBC Hindi NLI: Natural Language Inference Dataset in Hindi",
|
112 |
+
),
|
113 |
+
]
|
114 |
+
|
115 |
+
def _info(self):
|
116 |
+
|
117 |
+
return datasets.DatasetInfo(
|
118 |
+
description=_DESCRIPTION,
|
119 |
+
features=datasets.Features(
|
120 |
+
{
|
121 |
+
"premise": datasets.Value("string"),
|
122 |
+
"hypothesis": datasets.Value("string"),
|
123 |
+
"label": datasets.ClassLabel(names=["not-entailment", "entailment"]),
|
124 |
+
"topic": datasets.ClassLabel(
|
125 |
+
names=["india", "news", "international", "entertainment", "sport", "science"]
|
126 |
+
),
|
127 |
+
}
|
128 |
+
),
|
129 |
+
supervised_keys=None,
|
130 |
+
homepage=_HOMEPAGE,
|
131 |
+
license=_LICENSE,
|
132 |
+
citation=_CITATION,
|
133 |
+
)
|
134 |
+
|
135 |
+
def _split_generators(self, dl_manager):
|
136 |
+
"""Returns SplitGenerators."""
|
137 |
+
train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
|
138 |
+
test_path = dl_manager.download_and_extract(_TEST_DOWNLOAD_URL)
|
139 |
+
valid_path = dl_manager.download_and_extract(_VALID_DOWNLOAD_URL)
|
140 |
+
|
141 |
+
return [
|
142 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
143 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": valid_path}),
|
144 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}),
|
145 |
+
]
|
146 |
+
|
147 |
+
def _generate_examples(self, filepath):
|
148 |
+
""" Yields examples. """
|
149 |
+
|
150 |
+
with open(filepath, encoding="utf-8") as tsv_file:
|
151 |
+
tsv_reader = csv.reader(tsv_file, delimiter="\t")
|
152 |
+
for id_, row in enumerate(tsv_reader):
|
153 |
+
if id_ == 0:
|
154 |
+
continue
|
155 |
+
(premise, hypothesis, label, topic) = row
|
156 |
+
yield id_, {
|
157 |
+
"premise": premise,
|
158 |
+
"hypothesis": hypothesis,
|
159 |
+
"label": 1 if label == "entailed" else 0,
|
160 |
+
"topic": int(topic),
|
161 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
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}}
|
dummy/bbc hindi nli/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61f8be49ae9ae7bab30d8d424d2b5dc20a31f9af500844db34d12b2ce75939f5
|
3 |
+
size 4072
|