added jsonl files and data loader script
Browse files- data/as_indicHeadlineGeneration_v1.0.tar.bz2 → Data/as_QuestionGeneration_v1.0.tar.bz2 +2 -2
- data/ml_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/bn_QuestionGeneration_v1.0.tar.bz2 +2 -2
- data/or_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/gu_QuestionGeneration_v1.0.tar.bz2 +2 -2
- data/pa_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/hi_QuestionGeneration_v1.0.tar.bz2 +2 -2
- Data/kn_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/ml_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/mr_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/or_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/pa_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/ta_QuestionGeneration_v1.0.tar.bz2 +3 -0
- Data/te_QuestionGeneration_v1.0.tar.bz2 +3 -0
- QuestionGeneration.py +112 -0
- data/bn_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/gu_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/hi_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/kn_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/mr_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/ta_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
- data/te_IndicHeadlineGeneration_v1.0.tar.bz2 +0 -3
data/as_indicHeadlineGeneration_v1.0.tar.bz2 → Data/as_QuestionGeneration_v1.0.tar.bz2
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3fcd798aec1b0eab7cb4adfbb4641195a114c618eb5887c9321de51ed0101d78
|
3 |
+
size 13792328
|
data/ml_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/bn_QuestionGeneration_v1.0.tar.bz2
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:856558f922cf12baacb4a46ce4573dc5b961e79f557d3e4243f8afe06b71810d
|
3 |
+
size 13975829
|
data/or_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/gu_QuestionGeneration_v1.0.tar.bz2
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be7c847db74fc9c5ba4b62d8888bdd155640b1e6986a0052bea7f7ec5f22d27a
|
3 |
+
size 14062661
|
data/pa_IndicHeadlineGeneration_v1.0.tar.bz2 → Data/hi_QuestionGeneration_v1.0.tar.bz2
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5140d49fd1359308a3d54a32899c7dafb21919f9575685d62a3a690455cbf5c1
|
3 |
+
size 14221745
|
Data/kn_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f61113cb0bd16d2ba222bf437c544e61be2d24c7dae792f87a7d72c29a3ed2a0
|
3 |
+
size 14482704
|
Data/ml_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5fc38b740de417a26721d01655d2ec97074e8eee84f77c34dffa12741ea12d07
|
3 |
+
size 14367279
|
Data/mr_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b4532ef06163355414fb1147f8fa65bb249d1f72e08eecd458d4c63f2f07aab5
|
3 |
+
size 14104474
|
Data/or_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:915a10f74e51d9c0389b85289985e043827e4f7f21a9b67587bb63767291c664
|
3 |
+
size 13627080
|
Data/pa_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e0d10e9c6aa71f381b1feae2d3eb578fa75820581e2c13a03b03dfd9e7145481
|
3 |
+
size 14018160
|
Data/ta_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b8e3248d0fd52f7d02a8bf6069dae80b4953717495f2d1a2ff83136002087783
|
3 |
+
size 14474929
|
Data/te_QuestionGeneration_v1.0.tar.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e59bdcf3d78e5f3da6ee2ae5f5e90f63961e65ab2d760ad2336210671d18b0c8
|
3 |
+
size 13614384
|
QuestionGeneration.py
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
|
4 |
+
import datasets
|
5 |
+
|
6 |
+
_CITATION = """\
|
7 |
+
@inproceedings{Kumar2022IndicNLGSM,
|
8 |
+
title={IndicNLG Suite: Multilingual Datasets for Diverse NLG Tasks in Indic Languages},
|
9 |
+
author={Aman Kumar and Himani Shrotriya and Prachi Sahu and Raj Dabre and Ratish Puduppully and Anoop Kunchukuttan and Amogh Mishra and Mitesh M. Khapra and Pratyush Kumar},
|
10 |
+
year={2022},
|
11 |
+
url = "https://arxiv.org/abs/2203.05437"
|
12 |
+
}
|
13 |
+
"""
|
14 |
+
|
15 |
+
_DESCRIPTION = """\
|
16 |
+
This is the Question Generation dataset released as part of IndicNLG Suite. Each
|
17 |
+
example has five fields: id, squad_id, answer, context and question. We create this dataset in eleven
|
18 |
+
languages including as, bn, gu, hi, kn, ml, mr, or, pa, ta, te. This is a translated data. The examples in each language are exactly similar but in different languages.
|
19 |
+
The number of examples in each language is 98,027.
|
20 |
+
"""
|
21 |
+
_HOMEPAGE = "https://indicnlp.ai4bharat.org/indicnlg-suite"
|
22 |
+
|
23 |
+
_LICENSE = "Creative Commons Attribution-NonCommercial 4.0 International Public License"
|
24 |
+
|
25 |
+
_URL = "https://huggingface.co/datasets/ai4bharat/IndicQuestionGeneration/resolve/main/data/{}_IndicQuestionGeneration_v{}.tar.bz2"
|
26 |
+
|
27 |
+
|
28 |
+
_LANGUAGES = [
|
29 |
+
"as",
|
30 |
+
"bn",
|
31 |
+
"gu",
|
32 |
+
"hi",
|
33 |
+
"kn",
|
34 |
+
"ml",
|
35 |
+
"mr",
|
36 |
+
"or",
|
37 |
+
"pa",
|
38 |
+
"ta",
|
39 |
+
"te"
|
40 |
+
]
|
41 |
+
|
42 |
+
|
43 |
+
class WikiBio(datasets.GeneratorBasedBuilder):
|
44 |
+
VERSION = datasets.Version("1.0.0")
|
45 |
+
|
46 |
+
BUILDER_CONFIGS = [
|
47 |
+
datasets.BuilderConfig(
|
48 |
+
name="{}".format(lang),
|
49 |
+
version=datasets.Version("1.0.0")
|
50 |
+
)
|
51 |
+
for lang in _LANGUAGES
|
52 |
+
]
|
53 |
+
|
54 |
+
def _info(self):
|
55 |
+
return datasets.DatasetInfo(
|
56 |
+
description=_DESCRIPTION,
|
57 |
+
features=datasets.Features(
|
58 |
+
{
|
59 |
+
"id": datasets.Value("string"),
|
60 |
+
"squad_id": datasets.Value("string"),
|
61 |
+
"answer": datasets.Value("string"),
|
62 |
+
"context": datasets.Value("string"),
|
63 |
+
"question": datasets.Value("string")
|
64 |
+
}
|
65 |
+
),
|
66 |
+
supervised_keys=None,
|
67 |
+
homepage=_HOMEPAGE,
|
68 |
+
citation=_CITATION,
|
69 |
+
license=_LICENSE,
|
70 |
+
version=self.VERSION,
|
71 |
+
)
|
72 |
+
|
73 |
+
def _split_generators(self, dl_manager):
|
74 |
+
"""Returns SplitGenerators."""
|
75 |
+
lang = str(self.config.name)
|
76 |
+
url = _URL.format(lang, self.VERSION.version_str[:-2])
|
77 |
+
|
78 |
+
data_dir = dl_manager.download_and_extract(url)
|
79 |
+
return [
|
80 |
+
datasets.SplitGenerator(
|
81 |
+
name=datasets.Split.TRAIN,
|
82 |
+
gen_kwargs={
|
83 |
+
"filepath": os.path.join(data_dir, "train_" + lang + ".jsonl"),
|
84 |
+
},
|
85 |
+
),
|
86 |
+
datasets.SplitGenerator(
|
87 |
+
name=datasets.Split.TEST,
|
88 |
+
gen_kwargs={
|
89 |
+
"filepath": os.path.join(data_dir, "test_" + lang + ".jsonl"),
|
90 |
+
},
|
91 |
+
),
|
92 |
+
datasets.SplitGenerator(
|
93 |
+
name=datasets.Split.VALIDATION,
|
94 |
+
gen_kwargs={
|
95 |
+
"filepath": os.path.join(data_dir, "val_" + lang + ".jsonl"),
|
96 |
+
},
|
97 |
+
),
|
98 |
+
]
|
99 |
+
|
100 |
+
def _generate_examples(self, filepath):
|
101 |
+
"""Yields examples as (key, example) tuples."""
|
102 |
+
with open(filepath, encoding="utf-8") as f:
|
103 |
+
for idx_, row in enumerate(f):
|
104 |
+
data = json.loads(row)
|
105 |
+
yield idx_, {
|
106 |
+
"id": data["id"],
|
107 |
+
"squad_id": data["squad_id"],
|
108 |
+
"answer": data["answer"],
|
109 |
+
"context": data["context"],
|
110 |
+
"question": data["question"]
|
111 |
+
|
112 |
+
}
|
data/bn_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:8de08080ab353fb1dcf644cc74df1d9d285b02bdadcce6b238886e22f3bdf80b
|
3 |
-
size 128604069
|
|
|
|
|
|
|
|
data/gu_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0ae338760ea76c35fcbdda35ca15fa0b2a017f507e610b383e2839554b670909
|
3 |
-
size 214732661
|
|
|
|
|
|
|
|
data/hi_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d9cc8bbbb3846127ddee1a98f0a500caab8be958d5715af5b77e29a1a47e37e5
|
3 |
-
size 341339170
|
|
|
|
|
|
|
|
data/kn_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:132c629deb5e3c26427c1c7f4a6eea561679f70c6b3d2f2a38e8ef1eba496ef7
|
3 |
-
size 125079007
|
|
|
|
|
|
|
|
data/mr_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:875d9ea231232f763f8664c7083782625d95a7c85299e262c55861c92c52c624
|
3 |
-
size 111393670
|
|
|
|
|
|
|
|
data/ta_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7b4b0809cc58b5c6ca342283c10352cf96f3c30e1e7f3ed115bb220da85446d6
|
3 |
-
size 61179077
|
|
|
|
|
|
|
|
data/te_IndicHeadlineGeneration_v1.0.tar.bz2
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:73d99e8a8978935d2a434d6258b431426e267dd06416520e2d682984ce355a3a
|
3 |
-
size 23443452
|
|
|
|
|
|
|
|