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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 85,
|
6 |
+
"id": "138769da",
|
7 |
+
"metadata": {},
|
8 |
+
"outputs": [],
|
9 |
+
"source": [
|
10 |
+
"import os\n",
|
11 |
+
"import requests\n",
|
12 |
+
"import itertools\n",
|
13 |
+
"import pandas as pd\n",
|
14 |
+
"from bs4 import BeautifulSoup\n",
|
15 |
+
"from tqdm import trange\n",
|
16 |
+
"import datasets as dst # to create a huggingface dataset\n",
|
17 |
+
"\n",
|
18 |
+
"from chainfury.utils import threaded_map, to_json, from_json, get_files_in_folder"
|
19 |
+
]
|
20 |
+
},
|
21 |
+
{
|
22 |
+
"cell_type": "code",
|
23 |
+
"execution_count": 2,
|
24 |
+
"id": "f51b009f",
|
25 |
+
"metadata": {},
|
26 |
+
"outputs": [],
|
27 |
+
"source": [
|
28 |
+
"def _get_page_html(script, chapter_n, sutra_n, get_trans: bool = True, v: bool = False):\n",
|
29 |
+
" translations = {\n",
|
30 |
+
" \"htrskd\": 1, # Hindi Translation By Swami Ramsukhdas\n",
|
31 |
+
" \"httyn\": 1, # Hindi Translation By Swami Tejomayananda\n",
|
32 |
+
" \"htshg\": 1, # Hindi Translation Of Sri Shankaracharya's Sanskrit Commentary By Sri Harikrishnadas Goenka\n",
|
33 |
+
" \"scsh\": 1, # Sanskrit Commentary By Sri Shankaracharya\n",
|
34 |
+
" \"hcchi\": 1, # Hindi Commentary By Swami Chinmayananda\n",
|
35 |
+
" \"hcrskd\": 1, # Hindi Commentary By Swami Ramsukhdas\n",
|
36 |
+
" \"scang\": 1, # Sanskrit Commentary By Sri Abhinavgupta\n",
|
37 |
+
" \"scram\": 1, # Sanskrit Commentary By Sri Ramanujacharya\n",
|
38 |
+
" \"scanand\": 1, # Sanskrit Commentary By Sri Anandgiri\n",
|
39 |
+
" \"scjaya\": 1, # Sanskrit Commentary By Sri Jayatirtha\n",
|
40 |
+
" \"scmad\": 1, # Sanskrit Commentary By Sri Madhvacharya\n",
|
41 |
+
" \"scval\": 1, # Sanskrit Commentary By Sri Vallabhacharya\n",
|
42 |
+
" \"scms\": 1, # Sanskrit Commentary By Sri Madhusudan Saraswati\n",
|
43 |
+
" \"scsri\": 1, # Sanskrit Commentary By Sri Sridhara Swami\n",
|
44 |
+
" \"scvv\": 1, # Sanskrit Commentary By Sri Vedantadeshikacharya Venkatanatha\n",
|
45 |
+
" \"scpur\": 1, # Sanskrit Commentary By Sri Purushottamji\n",
|
46 |
+
" \"scneel\": 1, # Sanskrit Commentary By Sri Neelkanth\n",
|
47 |
+
" \"scdhan\": 1, # Sanskrit Commentary By Sri Dhanpati\n",
|
48 |
+
" \"ecsiva\": 1, # English Commentary By Swami Sivananda\n",
|
49 |
+
" \"etsiva\": 1, # English Translation By Swami Sivananda\n",
|
50 |
+
" \"etpurohit\": 1, # English Translation By Purohit Swami\n",
|
51 |
+
" \"etgb\": 1, # English Translation By Swami Gambirananda\n",
|
52 |
+
" \"setgb\": 1, # English Translation Of Sri Shankaracharya By Swami Gambirananda\n",
|
53 |
+
" \"etssa\": 1, # English Translation By Dr. S. Sankaranarayan\n",
|
54 |
+
" \"etassa\": 1, # English Translation of Abhinavgupta's Sanskrit Commentary By Dr. S. Sankaranarayan\n",
|
55 |
+
" \"etradi\": 1, # English Translation of Ramanujacharya's Sanskrit Commentary By Swami Adidevananda\n",
|
56 |
+
" \"etadi\": 1, # English Translation By Swami Adidevananda\n",
|
57 |
+
" }\n",
|
58 |
+
" params = {\n",
|
59 |
+
" \"language\": script,\n",
|
60 |
+
" \"field_chapter_value\": chapter_n,\n",
|
61 |
+
" \"field_nsutra_value\": sutra_n,\n",
|
62 |
+
" \"show_mool\": 1,\n",
|
63 |
+
" }\n",
|
64 |
+
" if get_trans:\n",
|
65 |
+
" params.update(translations)\n",
|
66 |
+
" r = requests.get(\n",
|
67 |
+
" \"https://www.gitasupersite.iitk.ac.in/srimad\",\n",
|
68 |
+
" params = params\n",
|
69 |
+
" )\n",
|
70 |
+
" if v:\n",
|
71 |
+
" print(r.url)\n",
|
72 |
+
" r.raise_for_status()\n",
|
73 |
+
" soup = BeautifulSoup(r.text)\n",
|
74 |
+
"\n",
|
75 |
+
" # get the main shloka text first\n",
|
76 |
+
" shloka_div = BeautifulSoup(\n",
|
77 |
+
" str(soup.find_all(\"div\", {\"class\": \"views-field views-field-body\"})[0].find_all(\"p\")[0])\n",
|
78 |
+
" .replace(\"<br/>\", \"\\n\")\n",
|
79 |
+
" )\n",
|
80 |
+
" shloka = shloka_div.getText().strip()\n",
|
81 |
+
"\n",
|
82 |
+
" # now find all the translations and store them\n",
|
83 |
+
" data = {\n",
|
84 |
+
" \"id\": f\"{chapter_n}.{sutra_n}\",\n",
|
85 |
+
" \"script\": script,\n",
|
86 |
+
" \"body\": shloka,\n",
|
87 |
+
" \"translations\": []\n",
|
88 |
+
" }\n",
|
89 |
+
" for t in translations:\n",
|
90 |
+
" trans_div = soup.find_all(\"div\", {\"class\": f\"views-field views-field-field-{t}\"})\n",
|
91 |
+
" if trans_div:\n",
|
92 |
+
" all_p = trans_div[0].find_all(\"p\")\n",
|
93 |
+
" if all_p:\n",
|
94 |
+
" trans_div = all_p[0]\n",
|
95 |
+
" trans = trans_div.getText().strip()\n",
|
96 |
+
" data[\"translations\"].append({\n",
|
97 |
+
" \"trans\": t,\n",
|
98 |
+
" \"content\": trans\n",
|
99 |
+
" })\n",
|
100 |
+
" return data\n",
|
101 |
+
"\n",
|
102 |
+
"def get_page_html(script, chapter_n, sutra_n, get_trans = True, pbar = None):\n",
|
103 |
+
" try:\n",
|
104 |
+
" out = _get_page_html(script, chapter_n, sutra_n, get_trans)\n",
|
105 |
+
" pbar.update(1)\n",
|
106 |
+
" return out, None\n",
|
107 |
+
" except Exception as e:\n",
|
108 |
+
" return (script, chapter_n, sutra_n), e"
|
109 |
+
]
|
110 |
+
},
|
111 |
+
{
|
112 |
+
"cell_type": "code",
|
113 |
+
"execution_count": 5,
|
114 |
+
"id": "954f795a",
|
115 |
+
"metadata": {},
|
116 |
+
"outputs": [
|
117 |
+
{
|
118 |
+
"data": {
|
119 |
+
"text/plain": [
|
120 |
+
"(701, [('dv', 1, 1, True)])"
|
121 |
+
]
|
122 |
+
},
|
123 |
+
"execution_count": 5,
|
124 |
+
"metadata": {},
|
125 |
+
"output_type": "execute_result"
|
126 |
+
}
|
127 |
+
],
|
128 |
+
"source": [
|
129 |
+
"scripts = {\n",
|
130 |
+
" \"dv\": \"Devanagari\",\n",
|
131 |
+
" \"as\": \"Assamese\",\n",
|
132 |
+
" \"bn\": \"Bengali\",\n",
|
133 |
+
" \"gu\": \"Gujarati\",\n",
|
134 |
+
" \"pa\": \"Gurmukhi\",\n",
|
135 |
+
" \"kn\": \"Kannada\",\n",
|
136 |
+
" \"ml\": \"Malayalam\",\n",
|
137 |
+
" \"or\": \"Odia\",\n",
|
138 |
+
" \"ro\": \"Roman\",\n",
|
139 |
+
" \"ta\": \"Tamil\",\n",
|
140 |
+
" \"te\": \"Telugu\",\n",
|
141 |
+
"}\n",
|
142 |
+
"chapter_to_max_sutra = {\n",
|
143 |
+
" \"1\": 47,\n",
|
144 |
+
" \"2\": 72,\n",
|
145 |
+
" \"3\": 43,\n",
|
146 |
+
" \"4\": 42,\n",
|
147 |
+
" \"5\": 29,\n",
|
148 |
+
" \"6\": 47,\n",
|
149 |
+
" \"7\": 30,\n",
|
150 |
+
" \"8\": 28,\n",
|
151 |
+
" \"9\": 34,\n",
|
152 |
+
" \"10\": 42,\n",
|
153 |
+
" \"11\": 55,\n",
|
154 |
+
" \"12\": 20,\n",
|
155 |
+
" \"13\": 35,\n",
|
156 |
+
" \"14\": 27,\n",
|
157 |
+
" \"15\": 20,\n",
|
158 |
+
" \"16\": 24,\n",
|
159 |
+
" \"17\": 28,\n",
|
160 |
+
" \"18\": 78,\n",
|
161 |
+
"}\n",
|
162 |
+
"\n",
|
163 |
+
"items = []\n",
|
164 |
+
"for sc in list(scripts.keys())[:1]:\n",
|
165 |
+
" for c in chapter_to_max_sutra:\n",
|
166 |
+
" items.extend([(sc, int(c), i, True) for i in range(1,chapter_to_max_sutra[c]+1)])\n",
|
167 |
+
"len(items), items[:1]"
|
168 |
+
]
|
169 |
+
},
|
170 |
+
{
|
171 |
+
"cell_type": "code",
|
172 |
+
"execution_count": 8,
|
173 |
+
"id": "f03fa731",
|
174 |
+
"metadata": {},
|
175 |
+
"outputs": [
|
176 |
+
{
|
177 |
+
"data": {
|
178 |
+
"text/plain": [
|
179 |
+
"{'id': '1.1',\n",
|
180 |
+
" 'script': 'dv',\n",
|
181 |
+
" 'body': 'धृतराष्ट्र उवाच\\n\\n\\n\\nधर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः।\\n\\n\\n\\nमामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय।।1.1।।',\n",
|
182 |
+
" 'translations': []}"
|
183 |
+
]
|
184 |
+
},
|
185 |
+
"execution_count": 8,
|
186 |
+
"metadata": {},
|
187 |
+
"output_type": "execute_result"
|
188 |
+
}
|
189 |
+
],
|
190 |
+
"source": [
|
191 |
+
"data = _get_page_html(*items[0])\n",
|
192 |
+
"data = _get_page_html(*items[0][:3], False)\n",
|
193 |
+
"data"
|
194 |
+
]
|
195 |
+
},
|
196 |
+
{
|
197 |
+
"cell_type": "markdown",
|
198 |
+
"id": "4eed8567",
|
199 |
+
"metadata": {},
|
200 |
+
"source": [
|
201 |
+
"## Create Gita singular dump"
|
202 |
+
]
|
203 |
+
},
|
204 |
+
{
|
205 |
+
"cell_type": "code",
|
206 |
+
"execution_count": 21,
|
207 |
+
"id": "f297d9a3",
|
208 |
+
"metadata": {},
|
209 |
+
"outputs": [
|
210 |
+
{
|
211 |
+
"name": "stderr",
|
212 |
+
"output_type": "stream",
|
213 |
+
"text": [
|
214 |
+
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7711/7711 [07:53<00:00, 16.29it/s]\n",
|
215 |
+
"100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 700/701 [00:49<00:00, 14.38it/s]"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
{
|
219 |
+
"name": "stdout",
|
220 |
+
"output_type": "stream",
|
221 |
+
"text": [
|
222 |
+
"CPU times: user 34.9 s, sys: 2.38 s, total: 37.3 s\n",
|
223 |
+
"Wall time: 49.8 s\n"
|
224 |
+
]
|
225 |
+
}
|
226 |
+
],
|
227 |
+
"source": [
|
228 |
+
"%%time\n",
|
229 |
+
"\n",
|
230 |
+
"pbar = trange(len(items))\n",
|
231 |
+
"inputs = [(*x, pbar) for x in items]\n",
|
232 |
+
"translation_data = threaded_map(get_page_html, inputs, max_threads=10)"
|
233 |
+
]
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"cell_type": "code",
|
237 |
+
"execution_count": 22,
|
238 |
+
"id": "80b8278b",
|
239 |
+
"metadata": {},
|
240 |
+
"outputs": [
|
241 |
+
{
|
242 |
+
"data": {
|
243 |
+
"text/plain": [
|
244 |
+
"(701, 0, 701)"
|
245 |
+
]
|
246 |
+
},
|
247 |
+
"execution_count": 22,
|
248 |
+
"metadata": {},
|
249 |
+
"output_type": "execute_result"
|
250 |
+
},
|
251 |
+
{
|
252 |
+
"name": "stderr",
|
253 |
+
"output_type": "stream",
|
254 |
+
"text": [
|
255 |
+
"\r",
|
256 |
+
"100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 701/701 [01:02<00:00, 14.38it/s]"
|
257 |
+
]
|
258 |
+
}
|
259 |
+
],
|
260 |
+
"source": [
|
261 |
+
"failed_args = []\n",
|
262 |
+
"for (out, err) in translation_data:\n",
|
263 |
+
" if err:\n",
|
264 |
+
" failed_args.append(out)\n",
|
265 |
+
"len(translation_data), len(failed_args), len(inputs)"
|
266 |
+
]
|
267 |
+
},
|
268 |
+
{
|
269 |
+
"cell_type": "code",
|
270 |
+
"execution_count": null,
|
271 |
+
"id": "acd03e14",
|
272 |
+
"metadata": {},
|
273 |
+
"outputs": [],
|
274 |
+
"source": [
|
275 |
+
"translation_data[0]"
|
276 |
+
]
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"cell_type": "code",
|
280 |
+
"execution_count": 11,
|
281 |
+
"id": "7956f645",
|
282 |
+
"metadata": {},
|
283 |
+
"outputs": [
|
284 |
+
{
|
285 |
+
"data": {
|
286 |
+
"text/plain": [
|
287 |
+
"(7711, [('dv', 1, 1, False)])"
|
288 |
+
]
|
289 |
+
},
|
290 |
+
"execution_count": 11,
|
291 |
+
"metadata": {},
|
292 |
+
"output_type": "execute_result"
|
293 |
+
}
|
294 |
+
],
|
295 |
+
"source": [
|
296 |
+
"# now download all the translations\n",
|
297 |
+
"script_items = []\n",
|
298 |
+
"for sc in list(scripts.keys()):\n",
|
299 |
+
" for c in chapter_to_max_sutra:\n",
|
300 |
+
" script_items.extend([(sc, int(c), i, False) for i in range(1,chapter_to_max_sutra[c]+1)])\n",
|
301 |
+
"len(script_items), script_items[:1]"
|
302 |
+
]
|
303 |
+
},
|
304 |
+
{
|
305 |
+
"cell_type": "code",
|
306 |
+
"execution_count": 13,
|
307 |
+
"id": "a5f3781c",
|
308 |
+
"metadata": {},
|
309 |
+
"outputs": [
|
310 |
+
{
|
311 |
+
"data": {
|
312 |
+
"text/plain": [
|
313 |
+
"{'id': '1.1',\n",
|
314 |
+
" 'script': 'dv',\n",
|
315 |
+
" 'body': 'धृतराष्ट्र उवाच\\n\\n\\n\\nधर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः।\\n\\n\\n\\nमामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय।।1.1।।',\n",
|
316 |
+
" 'translations': []}"
|
317 |
+
]
|
318 |
+
},
|
319 |
+
"execution_count": 13,
|
320 |
+
"metadata": {},
|
321 |
+
"output_type": "execute_result"
|
322 |
+
}
|
323 |
+
],
|
324 |
+
"source": [
|
325 |
+
"data = _get_page_html(*script_items[0])\n",
|
326 |
+
"data"
|
327 |
+
]
|
328 |
+
},
|
329 |
+
{
|
330 |
+
"cell_type": "code",
|
331 |
+
"execution_count": null,
|
332 |
+
"id": "3ca21550",
|
333 |
+
"metadata": {
|
334 |
+
"scrolled": true
|
335 |
+
},
|
336 |
+
"outputs": [],
|
337 |
+
"source": [
|
338 |
+
"%%time\n",
|
339 |
+
"pbar = trange(len(script_items))\n",
|
340 |
+
"inputs = [(*x, pbar) for x in script_items]\n",
|
341 |
+
"translit_data = threaded_map(get_page_html, inputs)"
|
342 |
+
]
|
343 |
+
},
|
344 |
+
{
|
345 |
+
"cell_type": "code",
|
346 |
+
"execution_count": 42,
|
347 |
+
"id": "87f03939",
|
348 |
+
"metadata": {},
|
349 |
+
"outputs": [
|
350 |
+
{
|
351 |
+
"data": {
|
352 |
+
"text/plain": [
|
353 |
+
"(7711, 0, 7711)"
|
354 |
+
]
|
355 |
+
},
|
356 |
+
"execution_count": 42,
|
357 |
+
"metadata": {},
|
358 |
+
"output_type": "execute_result"
|
359 |
+
}
|
360 |
+
],
|
361 |
+
"source": [
|
362 |
+
"failed_args = []\n",
|
363 |
+
"for (out, err) in translit_data:\n",
|
364 |
+
" if err:\n",
|
365 |
+
" failed_args.append(out)\n",
|
366 |
+
"len(translit_data), len(failed_args), len(translit_data)"
|
367 |
+
]
|
368 |
+
},
|
369 |
+
{
|
370 |
+
"cell_type": "code",
|
371 |
+
"execution_count": 43,
|
372 |
+
"id": "dc8bead5",
|
373 |
+
"metadata": {},
|
374 |
+
"outputs": [
|
375 |
+
{
|
376 |
+
"data": {
|
377 |
+
"text/plain": [
|
378 |
+
"({'id': '1.1',\n",
|
379 |
+
" 'script': 'dv',\n",
|
380 |
+
" 'body': 'धृतराष्ट्र उवाच\\n\\n\\n\\nधर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः।\\n\\n\\n\\nमामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय।।1.1।।',\n",
|
381 |
+
" 'translations': []},\n",
|
382 |
+
" None)"
|
383 |
+
]
|
384 |
+
},
|
385 |
+
"execution_count": 43,
|
386 |
+
"metadata": {},
|
387 |
+
"output_type": "execute_result"
|
388 |
+
},
|
389 |
+
{
|
390 |
+
"name": "stderr",
|
391 |
+
"output_type": "stream",
|
392 |
+
"text": [
|
393 |
+
"\n",
|
394 |
+
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7711/7711 [04:48<00:00, 8.77it/s]\u001b[A"
|
395 |
+
]
|
396 |
+
}
|
397 |
+
],
|
398 |
+
"source": [
|
399 |
+
"translit_data[0]"
|
400 |
+
]
|
401 |
+
},
|
402 |
+
{
|
403 |
+
"cell_type": "code",
|
404 |
+
"execution_count": 69,
|
405 |
+
"id": "12908809",
|
406 |
+
"metadata": {},
|
407 |
+
"outputs": [],
|
408 |
+
"source": [
|
409 |
+
"# combine the translation and transliteration data\n",
|
410 |
+
"all_rows = []\n",
|
411 |
+
"for x, _ in translation_data:\n",
|
412 |
+
" data = {\n",
|
413 |
+
" \"shloka_id\": x[\"id\"],\n",
|
414 |
+
" \"chapter\": x[\"id\"].split(\".\")[0],\n",
|
415 |
+
" \"sutra\": x[\"id\"].split(\".\")[1],\n",
|
416 |
+
" }\n",
|
417 |
+
" for t in x[\"translations\"]:\n",
|
418 |
+
" if (\"did not comment on this sloka.\" in t[\"content\"] or\n",
|
419 |
+
" \"No commentary\" in t[\"content\"]\n",
|
420 |
+
" ):\n",
|
421 |
+
" continue\n",
|
422 |
+
" data[\"trans-\" + t[\"trans\"]] = t[\"content\"]\n",
|
423 |
+
" shloka_lits = list(filter(\n",
|
424 |
+
" lambda y: y[0][\"id\"] == x[\"id\"],\n",
|
425 |
+
" translit_data\n",
|
426 |
+
" ))\n",
|
427 |
+
" for td, _ in shloka_lits:\n",
|
428 |
+
" data[f\"script-\" + td[\"script\"]] = td[\"body\"]\n",
|
429 |
+
" all_rows.append(data)"
|
430 |
+
]
|
431 |
+
},
|
432 |
+
{
|
433 |
+
"cell_type": "code",
|
434 |
+
"execution_count": 83,
|
435 |
+
"id": "b5e054fd",
|
436 |
+
"metadata": {},
|
437 |
+
"outputs": [
|
438 |
+
{
|
439 |
+
"data": {
|
440 |
+
"text/html": [
|
441 |
+
"<div>\n",
|
442 |
+
"<style scoped>\n",
|
443 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
444 |
+
" vertical-align: middle;\n",
|
445 |
+
" }\n",
|
446 |
+
"\n",
|
447 |
+
" .dataframe tbody tr th {\n",
|
448 |
+
" vertical-align: top;\n",
|
449 |
+
" }\n",
|
450 |
+
"\n",
|
451 |
+
" .dataframe thead th {\n",
|
452 |
+
" text-align: right;\n",
|
453 |
+
" }\n",
|
454 |
+
"</style>\n",
|
455 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
456 |
+
" <thead>\n",
|
457 |
+
" <tr style=\"text-align: right;\">\n",
|
458 |
+
" <th></th>\n",
|
459 |
+
" <th>shloka_id</th>\n",
|
460 |
+
" <th>chapter</th>\n",
|
461 |
+
" <th>sutra</th>\n",
|
462 |
+
" <th>trans-htrskd</th>\n",
|
463 |
+
" <th>trans-httyn</th>\n",
|
464 |
+
" <th>trans-hcchi</th>\n",
|
465 |
+
" <th>trans-hcrskd</th>\n",
|
466 |
+
" <th>trans-scang</th>\n",
|
467 |
+
" <th>trans-scram</th>\n",
|
468 |
+
" <th>trans-scanand</th>\n",
|
469 |
+
" <th>...</th>\n",
|
470 |
+
" <th>script-ml</th>\n",
|
471 |
+
" <th>script-or</th>\n",
|
472 |
+
" <th>script-ro</th>\n",
|
473 |
+
" <th>script-ta</th>\n",
|
474 |
+
" <th>script-te</th>\n",
|
475 |
+
" <th>trans-htshg</th>\n",
|
476 |
+
" <th>trans-scsh</th>\n",
|
477 |
+
" <th>trans-setgb</th>\n",
|
478 |
+
" <th>trans-scjaya</th>\n",
|
479 |
+
" <th>trans-scmad</th>\n",
|
480 |
+
" </tr>\n",
|
481 |
+
" </thead>\n",
|
482 |
+
" <tbody>\n",
|
483 |
+
" <tr>\n",
|
484 |
+
" <th>0</th>\n",
|
485 |
+
" <td>1.1</td>\n",
|
486 |
+
" <td>1</td>\n",
|
487 |
+
" <td>1</td>\n",
|
488 |
+
" <td>।।1.1।। धृतराष्ट्र बोले (टिप्पणी प0 1.2) - हे ...</td>\n",
|
489 |
+
" <td>।।1.1।।धृतराष्ट्र ने कहा -- हे संजय ! धर्मभूमि...</td>\n",
|
490 |
+
" <td>।।1.1।। सम्पूर्ण गीता में यही एक मात्र श्लोक अ...</td>\n",
|
491 |
+
" <td>1।।व्याख्या-- 'धर्मक्षेत्रे' 'कुरुक्षेत्रे'-- ...</td>\n",
|
492 |
+
" <td>।।1.1।।धर्मक्षेत्र इति। अत्र केचित् व्याख्याव...</td>\n",
|
493 |
+
" <td>।।1.1।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ...</td>\n",
|
494 |
+
" <td>।।1.1।।एवं गीताशास्त्रस्य साध्यसाधनभूतनिष्ठाद्...</td>\n",
|
495 |
+
" <td>...</td>\n",
|
496 |
+
" <td>ധൃതരാഷ്ട്ര ഉവാച\\n\\nധര്മക്ഷേത്രേ കുരുക്ഷേത്രേ സ...</td>\n",
|
497 |
+
" <td>ଧୃତରାଷ୍ଟ୍ର ଉବାଚ\\n\\nଧର୍ମକ୍ଷେତ୍ରେ କୁରୁକ୍ଷେତ୍ରେ ସ...</td>\n",
|
498 |
+
" <td>dhṛtarāṣṭra uvāca\\n\\ndharmakṣētrē kurukṣētrē s...</td>\n",
|
499 |
+
" <td>தரிதராஷ்ட்ர உவாச\\n\\nதர்மக்ஷேத்ரே குருக்ஷேத்ரே ...</td>\n",
|
500 |
+
" <td>ధృతరాష్ట్ర ఉవాచ\\n\\nధర్మక్షేత్రే కురుక్షేత్రే స...</td>\n",
|
501 |
+
" <td>NaN</td>\n",
|
502 |
+
" <td>NaN</td>\n",
|
503 |
+
" <td>NaN</td>\n",
|
504 |
+
" <td>NaN</td>\n",
|
505 |
+
" <td>NaN</td>\n",
|
506 |
+
" </tr>\n",
|
507 |
+
" <tr>\n",
|
508 |
+
" <th>1</th>\n",
|
509 |
+
" <td>1.2</td>\n",
|
510 |
+
" <td>1</td>\n",
|
511 |
+
" <td>2</td>\n",
|
512 |
+
" <td>।।1.2।। संजय बोले - उस समय वज्रव्यूह-से खड़ी ह...</td>\n",
|
513 |
+
" <td>।।1.2।।संजय ने कहा -- पाण्डव-सैन्य की व्यूह रच...</td>\n",
|
514 |
+
" <td>।।1.2।। इस श्लोक से आगे संजय ने कुरुक्षेत्र मे...</td>\n",
|
515 |
+
" <td>।।1.2।। व्याख्या-- 'तदा'-- जिस समय दोनों सेनाए...</td>\n",
|
516 |
+
" <td>।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब...</td>\n",
|
517 |
+
" <td>।।1.2।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ...</td>\n",
|
518 |
+
" <td>।।1.2।।किमस्मदीयं प्रबलं बलं प्रतिलभ्य धीरपुरु...</td>\n",
|
519 |
+
" <td>...</td>\n",
|
520 |
+
" <td>��ഞ്ജയ ഉവാച\\n\\nദൃഷ്ട്വാ തു പാണ്ഡവാനീകം വ്യൂഢം ദ...</td>\n",
|
521 |
+
" <td>ସଞ୍ଜଯ ଉବାଚ\\n\\nଦୃଷ୍ଟ୍ବା ତୁ ପାଣ୍ଡବାନୀକଂ ବ୍ଯୂଢଂ ଦ...</td>\n",
|
522 |
+
" <td>sañjaya uvāca\\n\\ndṛṣṭvā tu pāṇḍavānīkaṅ vyūḍha...</td>\n",
|
523 |
+
" <td>ஸஞ்ஜய உவாச\\n\\nதரிஷ்ட்வா து பாண்டவாநீகஂ வ்யூடஂ ...</td>\n",
|
524 |
+
" <td>సఞ్జయ ఉవాచ\\n\\nదృష్ట్వా తు పాణ్డవానీకం వ్యూఢం ద...</td>\n",
|
525 |
+
" <td>NaN</td>\n",
|
526 |
+
" <td>NaN</td>\n",
|
527 |
+
" <td>NaN</td>\n",
|
528 |
+
" <td>NaN</td>\n",
|
529 |
+
" <td>NaN</td>\n",
|
530 |
+
" </tr>\n",
|
531 |
+
" <tr>\n",
|
532 |
+
" <th>2</th>\n",
|
533 |
+
" <td>1.3</td>\n",
|
534 |
+
" <td>1</td>\n",
|
535 |
+
" <td>3</td>\n",
|
536 |
+
" <td>।।1.3।। हे आचार्य! आपके बुद्धिमान् शिष्य द्रुप...</td>\n",
|
537 |
+
" <td>।।1.3।।हे आचार्य ! आपके बुद्धिमान शिष्य द्रुपद...</td>\n",
|
538 |
+
" <td>।।1.3।। वास्तव में दुर्योधन की यह मूर्खता है क...</td>\n",
|
539 |
+
" <td>1.3।। व्याख्या--'आचार्य' द्रोणके लिये 'आचार्य'...</td>\n",
|
540 |
+
" <td>।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब...</td>\n",
|
541 |
+
" <td>।।1.3।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ...</td>\n",
|
542 |
+
" <td>।।1.3।।तदेव वचनमुदाहरति पश्येति। एतामस्मदभ्...</td>\n",
|
543 |
+
" <td>...</td>\n",
|
544 |
+
" <td>പശ്യൈതാം പാണ്ഡുപുത്രാണാമാചാര്യ മഹതീം ചമൂമ്.\\n\\...</td>\n",
|
545 |
+
" <td>ପଶ୍ଯୈତାଂ ପାଣ୍ଡୁପୁତ୍ରାଣାମାଚାର୍ଯ ମହତୀଂ ଚମୂମ୍|\\n\\...</td>\n",
|
546 |
+
" <td>paśyaitāṅ pāṇḍuputrāṇāmācārya mahatīṅ camūm.\\n...</td>\n",
|
547 |
+
" <td>பஷ்யைதாஂ பாண்டுபுத்ராணாமாசார்ய மஹதீஂ சமூம்.\\n\\...</td>\n",
|
548 |
+
" <td>పశ్యైతాం పాణ్డుపుత్రాణామాచార్య మహతీం చమూమ్.\\n\\...</td>\n",
|
549 |
+
" <td>NaN</td>\n",
|
550 |
+
" <td>NaN</td>\n",
|
551 |
+
" <td>NaN</td>\n",
|
552 |
+
" <td>NaN</td>\n",
|
553 |
+
" <td>NaN</td>\n",
|
554 |
+
" </tr>\n",
|
555 |
+
" <tr>\n",
|
556 |
+
" <th>3</th>\n",
|
557 |
+
" <td>1.4</td>\n",
|
558 |
+
" <td>1</td>\n",
|
559 |
+
" <td>4</td>\n",
|
560 |
+
" <td>।।1.4 -- 1.6।। यहाँ (पाण्डवों की सेना में) बड़...</td>\n",
|
561 |
+
" <td>।।1.4।।इस सेना में महान् धनुर्धारी शूर योद्धा ...</td>\n",
|
562 |
+
" <td>NaN</td>\n",
|
563 |
+
" <td>।।1.4 --1.6।। व्याख्या--'अत्र शूरा महेष्वासा भ...</td>\n",
|
564 |
+
" <td>।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब...</td>\n",
|
565 |
+
" <td>।।1.4।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ...</td>\n",
|
566 |
+
" <td>।।1.4।।अन्येऽपि प्रतिपक्षे पराक्रमभाजो बहवः सन...</td>\n",
|
567 |
+
" <td>...</td>\n",
|
568 |
+
" <td>അത്ര ശൂരാ മഹേഷ്വാസാ ഭീമാര്ജുനസമാ യുധി.\\n\\nയുയു...</td>\n",
|
569 |
+
" <td>ଅତ୍ର ଶୂରା ମହେଷ୍ବାସା ଭୀମାର୍ଜୁନସମା ଯୁଧି|\\n\\nଯୁଯୁ...</td>\n",
|
570 |
+
" <td>atra śūrā mahēṣvāsā bhīmārjunasamā yudhi.\\n\\ny...</td>\n",
|
571 |
+
" <td>அத்ர ஷூரா மஹேஷ்வாஸா பீமார்ஜுநஸமா யுதி.\\n\\nயுயு...</td>\n",
|
572 |
+
" <td>అత్ర శూరా మహేష్వాసా భీమార్జునసమా యుధి.\\n\\nయుయు...</td>\n",
|
573 |
+
" <td>NaN</td>\n",
|
574 |
+
" <td>NaN</td>\n",
|
575 |
+
" <td>NaN</td>\n",
|
576 |
+
" <td>NaN</td>\n",
|
577 |
+
" <td>NaN</td>\n",
|
578 |
+
" </tr>\n",
|
579 |
+
" </tbody>\n",
|
580 |
+
"</table>\n",
|
581 |
+
"<p>4 rows × 41 columns</p>\n",
|
582 |
+
"</div>"
|
583 |
+
],
|
584 |
+
"text/plain": [
|
585 |
+
" shloka_id chapter sutra trans-htrskd \\\n",
|
586 |
+
"0 1.1 1 1 ।।1.1।। धृतराष्ट्र बोले (टिप्पणी प0 1.2) - हे ... \n",
|
587 |
+
"1 1.2 1 2 ।।1.2।। संजय बोले - उस समय वज्रव्यूह-से खड़ी ह... \n",
|
588 |
+
"2 1.3 1 3 ।।1.3।। हे आचार्य! आपके बुद्धिमान् शिष्य द्रुप... \n",
|
589 |
+
"3 1.4 1 4 ।।1.4 -- 1.6।। यहाँ (पाण्डवों की सेना में) बड़... \n",
|
590 |
+
"\n",
|
591 |
+
" trans-httyn \\\n",
|
592 |
+
"0 ।।1.1।।धृतराष्ट्र ने कहा -- हे संजय ! धर्मभूमि... \n",
|
593 |
+
"1 ।।1.2।।संजय ने कहा -- पाण्डव-सैन्य की व्यूह रच... \n",
|
594 |
+
"2 ।।1.3।।हे आचार्य ! आपके बुद्धिमान शिष्य द्रुपद... \n",
|
595 |
+
"3 ।।1.4।।इस सेना में महान् धनुर्धारी शूर योद्धा ... \n",
|
596 |
+
"\n",
|
597 |
+
" trans-hcchi \\\n",
|
598 |
+
"0 ।।1.1।। सम्पूर्ण गीता में यही एक मात्र श्लोक अ... \n",
|
599 |
+
"1 ।।1.2।। इस श्लोक से आगे संजय ने कुरुक्षेत्र मे... \n",
|
600 |
+
"2 ।।1.3।। वास्तव में दुर्योधन की यह मूर्खता है क... \n",
|
601 |
+
"3 NaN \n",
|
602 |
+
"\n",
|
603 |
+
" trans-hcrskd \\\n",
|
604 |
+
"0 1।।व्याख्या-- 'धर्मक्षेत्रे' 'कुरुक्षेत्रे'-- ... \n",
|
605 |
+
"1 ।।1.2।। व्याख्या-- 'तदा'-- जिस समय दोनों सेनाए... \n",
|
606 |
+
"2 1.3।। व्याख्या--'आचार्य' द्रोणके लिये 'आचार्य'... \n",
|
607 |
+
"3 ।।1.4 --1.6।। व्याख्या--'अत्र शूरा महेष्वासा भ... \n",
|
608 |
+
"\n",
|
609 |
+
" trans-scang \\\n",
|
610 |
+
"0 ।।1.1।।धर्मक्षेत्र इति। अत्र केचित् व्याख्याव... \n",
|
611 |
+
"1 ।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब... \n",
|
612 |
+
"2 ।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब... \n",
|
613 |
+
"3 ।।1.2 1.9।।किं वा अनेन बहुपरिगणनेन (K omits ब... \n",
|
614 |
+
"\n",
|
615 |
+
" trans-scram \\\n",
|
616 |
+
"0 ।।1.1।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ... \n",
|
617 |
+
"1 ।।1.2।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ... \n",
|
618 |
+
"2 ।।1.3।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ... \n",
|
619 |
+
"3 ।।1.4।।धृतराष्ट्र उवाच सञ्जय उवाच दुर्योधनः ... \n",
|
620 |
+
"\n",
|
621 |
+
" trans-scanand ... \\\n",
|
622 |
+
"0 ।।1.1।।एवं गीताशास्त्रस्य साध्यसाधनभूतनिष्ठाद्... ... \n",
|
623 |
+
"1 ।।1.2।।किमस्मदीयं प्रबलं बलं प्रतिलभ्य धीरपुरु... ... \n",
|
624 |
+
"2 ।।1.3।।तदेव वचनमुदाहरति पश्येति। एतामस्मदभ्... ... \n",
|
625 |
+
"3 ।।1.4।।अन्येऽपि प्रतिपक्षे पराक्रमभाजो बहवः सन... ... \n",
|
626 |
+
"\n",
|
627 |
+
" script-ml \\\n",
|
628 |
+
"0 ധൃതരാഷ്ട്ര ഉവാച\\n\\nധര്മക്ഷേത്രേ കുരുക്ഷേത്രേ സ... \n",
|
629 |
+
"1 സഞ്ജയ ഉവാച\\n\\nദൃഷ്ട്വാ തു പാണ്ഡവാനീകം വ്യൂഢം ദ... \n",
|
630 |
+
"2 പശ്യൈതാം പാണ്ഡുപുത്രാണാമാചാര്യ മഹതീം ചമൂമ്.\\n\\... \n",
|
631 |
+
"3 അത്ര ശൂരാ മഹേഷ്വാസാ ഭീമാര്ജുനസമാ യുധി.\\n\\nയുയു... \n",
|
632 |
+
"\n",
|
633 |
+
" script-or \\\n",
|
634 |
+
"0 ଧୃତରାଷ୍ଟ୍ର ଉବାଚ\\n\\nଧର୍ମକ୍ଷେତ୍ରେ କୁରୁକ୍ଷେତ୍ରେ ସ... \n",
|
635 |
+
"1 ସଞ୍ଜଯ ଉବାଚ\\n\\nଦୃଷ୍ଟ୍ବା ତୁ ପାଣ୍ଡବାନୀକଂ ବ୍ଯୂଢଂ ଦ... \n",
|
636 |
+
"2 ପଶ୍ଯୈତାଂ ପାଣ୍ଡୁପୁତ୍ରାଣାମାଚାର୍ଯ ମହତୀଂ ଚମୂମ୍|\\n\\... \n",
|
637 |
+
"3 ଅତ୍ର ଶୂରା ମହେଷ୍ବାସା ଭୀମାର୍ଜୁନସମା ଯୁଧି|\\n\\nଯୁଯୁ... \n",
|
638 |
+
"\n",
|
639 |
+
" script-ro \\\n",
|
640 |
+
"0 dhṛtarāṣṭra uvāca\\n\\ndharmakṣētrē kurukṣētrē s... \n",
|
641 |
+
"1 sañjaya uvāca\\n\\ndṛṣṭvā tu pāṇḍavānīkaṅ vyūḍha... \n",
|
642 |
+
"2 paśyaitāṅ pāṇḍuputrāṇāmācārya mahatīṅ camūm.\\n... \n",
|
643 |
+
"3 atra śūrā mahēṣvāsā bhīmārjunasamā yudhi.\\n\\ny... \n",
|
644 |
+
"\n",
|
645 |
+
" script-ta \\\n",
|
646 |
+
"0 தரிதராஷ்ட்ர உவாச\\n\\nதர்மக்ஷேத்ரே குருக்ஷேத்ரே ... \n",
|
647 |
+
"1 ஸஞ்ஜய உவாச\\n\\nதரிஷ்ட்வா து பாண்டவாநீகஂ வ்யூடஂ ... \n",
|
648 |
+
"2 பஷ்யைதாஂ பாண்டுபுத்ராணாமாசார்ய மஹதீஂ சமூம்.\\n\\... \n",
|
649 |
+
"3 அத்ர ஷூரா மஹேஷ்வாஸா பீமார்ஜுநஸமா யுதி.\\n\\nயுயு... \n",
|
650 |
+
"\n",
|
651 |
+
" script-te trans-htshg trans-scsh \\\n",
|
652 |
+
"0 ధృతరాష్ట్ర ఉవాచ\\n\\nధర్మక్షేత్రే కురుక్షేత్రే స... NaN NaN \n",
|
653 |
+
"1 సఞ్జయ ఉవాచ\\n\\nదృష్ట్వా తు పాణ్డవానీకం వ్యూఢం ద... NaN NaN \n",
|
654 |
+
"2 పశ్యైతాం పాణ్డుపుత్రాణామాచార్య మహతీం చమూమ్.\\n\\... NaN NaN \n",
|
655 |
+
"3 అత్ర శూరా మహేష్వాసా భీమార్జునసమా యుధి.\\n\\nయుయు... NaN NaN \n",
|
656 |
+
"\n",
|
657 |
+
" trans-setgb trans-scjaya trans-scmad \n",
|
658 |
+
"0 NaN NaN NaN \n",
|
659 |
+
"1 NaN NaN NaN \n",
|
660 |
+
"2 NaN NaN NaN \n",
|
661 |
+
"3 NaN NaN NaN \n",
|
662 |
+
"\n",
|
663 |
+
"[4 rows x 41 columns]"
|
664 |
+
]
|
665 |
+
},
|
666 |
+
"execution_count": 83,
|
667 |
+
"metadata": {},
|
668 |
+
"output_type": "execute_result"
|
669 |
+
}
|
670 |
+
],
|
671 |
+
"source": [
|
672 |
+
"df_comb = pd.DataFrame(all_rows)\n",
|
673 |
+
"df_comb.head(4)"
|
674 |
+
]
|
675 |
+
},
|
676 |
+
{
|
677 |
+
"cell_type": "code",
|
678 |
+
"execution_count": 71,
|
679 |
+
"id": "5121c3f2",
|
680 |
+
"metadata": {},
|
681 |
+
"outputs": [
|
682 |
+
{
|
683 |
+
"name": "stdout",
|
684 |
+
"output_type": "stream",
|
685 |
+
"text": [
|
686 |
+
"fill: 96.72\n",
|
687 |
+
"empty: 3.28\n"
|
688 |
+
]
|
689 |
+
}
|
690 |
+
],
|
691 |
+
"source": [
|
692 |
+
"not_na = df_comb.notna().sum().sum() / (df_comb.shape[0] * df_comb.shape[1])\n",
|
693 |
+
"na = (df_comb.notna()==False).sum().sum() / (df_comb.shape[0] * df_comb.shape[1])\n",
|
694 |
+
"print(f\"fill: {not_na * 100:.2f}\", )\n",
|
695 |
+
"print(f\"empty: {na * 100:.2f}\", )"
|
696 |
+
]
|
697 |
+
},
|
698 |
+
{
|
699 |
+
"cell_type": "code",
|
700 |
+
"execution_count": 78,
|
701 |
+
"id": "e44bfce2",
|
702 |
+
"metadata": {},
|
703 |
+
"outputs": [
|
704 |
+
{
|
705 |
+
"data": {
|
706 |
+
"text/plain": [
|
707 |
+
"DatasetDict({\n",
|
708 |
+
" train: Dataset({\n",
|
709 |
+
" features: ['shloka_id', 'chapter', 'sutra', 'trans-htrskd', 'trans-httyn', 'trans-hcchi', 'trans-hcrskd', 'trans-scang', 'trans-scram', 'trans-scanand', 'trans-scval', 'trans-scms', 'trans-scsri', 'trans-scvv', 'trans-scpur', 'trans-scneel', 'trans-scdhan', 'trans-ecsiva', 'trans-etsiva', 'trans-etpurohit', 'trans-etgb', 'trans-etssa', 'trans-etassa', 'trans-etradi', 'trans-etadi', 'script-dv', 'script-as', 'script-bn', 'script-gu', 'script-pa', 'script-kn', 'script-ml', 'script-or', 'script-ro', 'script-ta', 'script-te', 'trans-htshg', 'trans-scsh', 'trans-setgb', 'trans-scjaya', 'trans-scmad'],\n",
|
710 |
+
" num_rows: 701\n",
|
711 |
+
" })\n",
|
712 |
+
"})"
|
713 |
+
]
|
714 |
+
},
|
715 |
+
"execution_count": 78,
|
716 |
+
"metadata": {},
|
717 |
+
"output_type": "execute_result"
|
718 |
+
}
|
719 |
+
],
|
720 |
+
"source": [
|
721 |
+
"gita_ds = dst.DatasetDict(train = dst.Dataset.from_pandas(df_comb))\n",
|
722 |
+
"gita_ds"
|
723 |
+
]
|
724 |
+
},
|
725 |
+
{
|
726 |
+
"cell_type": "code",
|
727 |
+
"execution_count": 82,
|
728 |
+
"id": "0f845d1c",
|
729 |
+
"metadata": {},
|
730 |
+
"outputs": [
|
731 |
+
{
|
732 |
+
"name": "stderr",
|
733 |
+
"output_type": "stream",
|
734 |
+
"text": [
|
735 |
+
"Pushing split train to the Hub.\n"
|
736 |
+
]
|
737 |
+
},
|
738 |
+
{
|
739 |
+
"data": {
|
740 |
+
"application/json": {
|
741 |
+
"ascii": false,
|
742 |
+
"bar_format": null,
|
743 |
+
"colour": null,
|
744 |
+
"elapsed": 0.026834726333618164,
|
745 |
+
"initial": 0,
|
746 |
+
"n": 0,
|
747 |
+
"ncols": null,
|
748 |
+
"nrows": 59,
|
749 |
+
"postfix": null,
|
750 |
+
"prefix": "Pushing dataset shards to the dataset hub",
|
751 |
+
"rate": null,
|
752 |
+
"total": 1,
|
753 |
+
"unit": "it",
|
754 |
+
"unit_divisor": 1000,
|
755 |
+
"unit_scale": false
|
756 |
+
},
|
757 |
+
"application/vnd.jupyter.widget-view+json": {
|
758 |
+
"model_id": "252b3d8b45be41369bd4e7e0b9e1eb60",
|
759 |
+
"version_major": 2,
|
760 |
+
"version_minor": 0
|
761 |
+
},
|
762 |
+
"text/plain": [
|
763 |
+
"Pushing dataset shards to the dataset hub: 0%| | 0/1 [00:00<?, ?it/s]"
|
764 |
+
]
|
765 |
+
},
|
766 |
+
"metadata": {},
|
767 |
+
"output_type": "display_data"
|
768 |
+
},
|
769 |
+
{
|
770 |
+
"data": {
|
771 |
+
"application/json": {
|
772 |
+
"ascii": false,
|
773 |
+
"bar_format": null,
|
774 |
+
"colour": null,
|
775 |
+
"elapsed": 0.030380964279174805,
|
776 |
+
"initial": 0,
|
777 |
+
"n": 0,
|
778 |
+
"ncols": null,
|
779 |
+
"nrows": 59,
|
780 |
+
"postfix": null,
|
781 |
+
"prefix": "Upload 1 LFS files",
|
782 |
+
"rate": null,
|
783 |
+
"total": 1,
|
784 |
+
"unit": "it",
|
785 |
+
"unit_divisor": 1000,
|
786 |
+
"unit_scale": false
|
787 |
+
},
|
788 |
+
"application/vnd.jupyter.widget-view+json": {
|
789 |
+
"model_id": "c885814232de4ac082290e5ea8fdf535",
|
790 |
+
"version_major": 2,
|
791 |
+
"version_minor": 0
|
792 |
+
},
|
793 |
+
"text/plain": [
|
794 |
+
"Upload 1 LFS files: 0%| | 0/1 [00:00<?, ?it/s]"
|
795 |
+
]
|
796 |
+
},
|
797 |
+
"metadata": {},
|
798 |
+
"output_type": "display_data"
|
799 |
+
},
|
800 |
+
{
|
801 |
+
"name": "stdout",
|
802 |
+
"output_type": "stream",
|
803 |
+
"text": [
|
804 |
+
"CPU times: user 493 ms, sys: 99.8 ms, total: 593 ms\n",
|
805 |
+
"Wall time: 6 s\n"
|
806 |
+
]
|
807 |
+
}
|
808 |
+
],
|
809 |
+
"source": [
|
810 |
+
"%%time\n",
|
811 |
+
"gita_ds.push_to_hub(\"yashnbx/gita_supersite_dump\")"
|
812 |
+
]
|
813 |
+
},
|
814 |
+
{
|
815 |
+
"cell_type": "markdown",
|
816 |
+
"id": "d6ecb773",
|
817 |
+
"metadata": {},
|
818 |
+
"source": [
|
819 |
+
"## Create the Sanskit TTS Dataset"
|
820 |
+
]
|
821 |
+
},
|
822 |
+
{
|
823 |
+
"cell_type": "code",
|
824 |
+
"execution_count": 20,
|
825 |
+
"id": "36c0d92b",
|
826 |
+
"metadata": {},
|
827 |
+
"outputs": [],
|
828 |
+
"source": [
|
829 |
+
"# now download the audio clips\n",
|
830 |
+
"def get_audio(chapter_n: int, sutra_n: int, pbar = None):\n",
|
831 |
+
" url = f\"https://www.gitasupersite.iitk.ac.in/sites/default/files/audio/CHAP{chapter_n}/{chapter_n}-{sutra_n}.MP3\"\n",
|
832 |
+
" os.makedirs(\"./audio\", exist_ok=True)\n",
|
833 |
+
" r = requests.get(url, stream = True)\n",
|
834 |
+
" fp = f'./audio/swami_brahmananda_{chapter_n}_{sutra_n}.mp3'\n",
|
835 |
+
" with open(fp, 'wb') as mp3:\n",
|
836 |
+
" for chunk in r.iter_content(chunk_size=int(1e5)):\n",
|
837 |
+
" mp3.write(chunk)\n",
|
838 |
+
" if pbar:\n",
|
839 |
+
" pbar.update(1)\n",
|
840 |
+
" return fp"
|
841 |
+
]
|
842 |
+
},
|
843 |
+
{
|
844 |
+
"cell_type": "code",
|
845 |
+
"execution_count": null,
|
846 |
+
"id": "b11dbd8b",
|
847 |
+
"metadata": {},
|
848 |
+
"outputs": [
|
849 |
+
{
|
850 |
+
"name": "stderr",
|
851 |
+
"output_type": "stream",
|
852 |
+
"text": [
|
853 |
+
"\r",
|
854 |
+
"100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 701/701 [00:31<00:00, 44.19it/s]"
|
855 |
+
]
|
856 |
+
}
|
857 |
+
],
|
858 |
+
"source": [
|
859 |
+
"pbar = trange(len(items))\n",
|
860 |
+
"inputs = [(*x[1:], pbar) for x in items]\n",
|
861 |
+
"_ = threaded_map(get_audio, inputs)"
|
862 |
+
]
|
863 |
+
},
|
864 |
+
{
|
865 |
+
"cell_type": "code",
|
866 |
+
"execution_count": 89,
|
867 |
+
"id": "2f7ba3c6",
|
868 |
+
"metadata": {},
|
869 |
+
"outputs": [],
|
870 |
+
"source": [
|
871 |
+
"for fp in get_files_in_folder(\"./audio\"):\n",
|
872 |
+
" print(fp)"
|
873 |
+
]
|
874 |
+
},
|
875 |
+
{
|
876 |
+
"cell_type": "code",
|
877 |
+
"execution_count": 110,
|
878 |
+
"id": "460dcb1b",
|
879 |
+
"metadata": {},
|
880 |
+
"outputs": [],
|
881 |
+
"source": [
|
882 |
+
"audio_files = !ls ./audio/\n",
|
883 |
+
"audio_files = [\"./audio/\"+x for x in audio_files]\n",
|
884 |
+
"sample = []\n",
|
885 |
+
"for fp in audio_files:\n",
|
886 |
+
" chapter_n, sutra_n = fp.split(\"_\")[2:4]\n",
|
887 |
+
" shloka_id = f\"{chapter_n}.{sutra_n[:-4]}\"\n",
|
888 |
+
" _df = df_comb[df_comb.shloka_id == shloka_id]\n",
|
889 |
+
" sample.append({\n",
|
890 |
+
" \"shloka_id\": shloka_id,\n",
|
891 |
+
" \"text\": _df[\"script-dv\"].item(),\n",
|
892 |
+
" \"audio\": fp\n",
|
893 |
+
" })"
|
894 |
+
]
|
895 |
+
},
|
896 |
+
{
|
897 |
+
"cell_type": "code",
|
898 |
+
"execution_count": 116,
|
899 |
+
"id": "cb33827e",
|
900 |
+
"metadata": {},
|
901 |
+
"outputs": [],
|
902 |
+
"source": [
|
903 |
+
"tts_ds = dst.DatasetDict(\n",
|
904 |
+
" train = dst.Dataset.from_list(sample).cast_column(\"audio\", dst.Audio())\n",
|
905 |
+
")"
|
906 |
+
]
|
907 |
+
},
|
908 |
+
{
|
909 |
+
"cell_type": "code",
|
910 |
+
"execution_count": 119,
|
911 |
+
"id": "4cbbeeac",
|
912 |
+
"metadata": {},
|
913 |
+
"outputs": [
|
914 |
+
{
|
915 |
+
"name": "stderr",
|
916 |
+
"output_type": "stream",
|
917 |
+
"text": [
|
918 |
+
"/opt/homebrew/lib/python3.10/site-packages/datasets/features/audio.py:310: UserWarning: Decoding mp3 with `librosa` instead of `torchaudio`, decoding is slow.\n",
|
919 |
+
" warnings.warn(\"Decoding mp3 with `librosa` instead of `torchaudio`, decoding is slow.\")\n"
|
920 |
+
]
|
921 |
+
},
|
922 |
+
{
|
923 |
+
"data": {
|
924 |
+
"text/plain": [
|
925 |
+
"{'shloka_id': '10.1',\n",
|
926 |
+
" 'text': 'श्री भगवानुवाच\\n\\n\\n\\nभूय एव महाबाहो श्रृणु मे परमं वचः।\\n\\n\\n\\nयत्तेऽहं प्रीयमाणाय वक्ष्यामि हितकाम्यया।।10.1।।',\n",
|
927 |
+
" 'audio': {'path': './audio/swami_brahmananda_10_1.mp3',\n",
|
928 |
+
" 'array': array([ 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, ...,\n",
|
929 |
+
" -4.2175071e-07, -4.5091804e-07, -2.9115546e-07], dtype=float32),\n",
|
930 |
+
" 'sampling_rate': 16000}}"
|
931 |
+
]
|
932 |
+
},
|
933 |
+
"execution_count": 119,
|
934 |
+
"metadata": {},
|
935 |
+
"output_type": "execute_result"
|
936 |
+
}
|
937 |
+
],
|
938 |
+
"source": [
|
939 |
+
"tts_ds[\"train\"][0]"
|
940 |
+
]
|
941 |
+
},
|
942 |
+
{
|
943 |
+
"cell_type": "code",
|
944 |
+
"execution_count": 120,
|
945 |
+
"id": "545e208d",
|
946 |
+
"metadata": {},
|
947 |
+
"outputs": [
|
948 |
+
{
|
949 |
+
"name": "stderr",
|
950 |
+
"output_type": "stream",
|
951 |
+
"text": [
|
952 |
+
"Pushing split train to the Hub.\n"
|
953 |
+
]
|
954 |
+
},
|
955 |
+
{
|
956 |
+
"data": {
|
957 |
+
"application/json": {
|
958 |
+
"ascii": false,
|
959 |
+
"bar_format": null,
|
960 |
+
"colour": null,
|
961 |
+
"elapsed": 0.030328035354614258,
|
962 |
+
"initial": 0,
|
963 |
+
"n": 0,
|
964 |
+
"ncols": null,
|
965 |
+
"nrows": 59,
|
966 |
+
"postfix": null,
|
967 |
+
"prefix": "",
|
968 |
+
"rate": null,
|
969 |
+
"total": 1,
|
970 |
+
"unit": "ba",
|
971 |
+
"unit_divisor": 1000,
|
972 |
+
"unit_scale": false
|
973 |
+
},
|
974 |
+
"application/vnd.jupyter.widget-view+json": {
|
975 |
+
"model_id": "9964e10a2c704d7fb54e6105b9108f43",
|
976 |
+
"version_major": 2,
|
977 |
+
"version_minor": 0
|
978 |
+
},
|
979 |
+
"text/plain": [
|
980 |
+
" 0%| | 0/1 [00:00<?, ?ba/s]"
|
981 |
+
]
|
982 |
+
},
|
983 |
+
"metadata": {},
|
984 |
+
"output_type": "display_data"
|
985 |
+
},
|
986 |
+
{
|
987 |
+
"data": {
|
988 |
+
"application/json": {
|
989 |
+
"ascii": false,
|
990 |
+
"bar_format": null,
|
991 |
+
"colour": null,
|
992 |
+
"elapsed": 0.008182048797607422,
|
993 |
+
"initial": 0,
|
994 |
+
"n": 0,
|
995 |
+
"ncols": null,
|
996 |
+
"nrows": 59,
|
997 |
+
"postfix": null,
|
998 |
+
"prefix": "Pushing dataset shards to the dataset hub",
|
999 |
+
"rate": null,
|
1000 |
+
"total": 1,
|
1001 |
+
"unit": "it",
|
1002 |
+
"unit_divisor": 1000,
|
1003 |
+
"unit_scale": false
|
1004 |
+
},
|
1005 |
+
"application/vnd.jupyter.widget-view+json": {
|
1006 |
+
"model_id": "c1901020973b4ac292c65f17fd85470e",
|
1007 |
+
"version_major": 2,
|
1008 |
+
"version_minor": 0
|
1009 |
+
},
|
1010 |
+
"text/plain": [
|
1011 |
+
"Pushing dataset shards to the dataset hub: 0%| | 0/1 [00:00<?, ?it/s]"
|
1012 |
+
]
|
1013 |
+
},
|
1014 |
+
"metadata": {},
|
1015 |
+
"output_type": "display_data"
|
1016 |
+
},
|
1017 |
+
{
|
1018 |
+
"data": {
|
1019 |
+
"application/json": {
|
1020 |
+
"ascii": false,
|
1021 |
+
"bar_format": null,
|
1022 |
+
"colour": null,
|
1023 |
+
"elapsed": 0.02718210220336914,
|
1024 |
+
"initial": 0,
|
1025 |
+
"n": 0,
|
1026 |
+
"ncols": null,
|
1027 |
+
"nrows": 59,
|
1028 |
+
"postfix": null,
|
1029 |
+
"prefix": "Upload 1 LFS files",
|
1030 |
+
"rate": null,
|
1031 |
+
"total": 1,
|
1032 |
+
"unit": "it",
|
1033 |
+
"unit_divisor": 1000,
|
1034 |
+
"unit_scale": false
|
1035 |
+
},
|
1036 |
+
"application/vnd.jupyter.widget-view+json": {
|
1037 |
+
"model_id": "dc348c7ad74747daa2b66a2f391c621b",
|
1038 |
+
"version_major": 2,
|
1039 |
+
"version_minor": 0
|
1040 |
+
},
|
1041 |
+
"text/plain": [
|
1042 |
+
"Upload 1 LFS files: 0%| | 0/1 [00:00<?, ?it/s]"
|
1043 |
+
]
|
1044 |
+
},
|
1045 |
+
"metadata": {},
|
1046 |
+
"output_type": "display_data"
|
1047 |
+
},
|
1048 |
+
{
|
1049 |
+
"name": "stdout",
|
1050 |
+
"output_type": "stream",
|
1051 |
+
"text": [
|
1052 |
+
"CPU times: user 587 ms, sys: 148 ms, total: 734 ms\n",
|
1053 |
+
"Wall time: 8.53 s\n"
|
1054 |
+
]
|
1055 |
+
}
|
1056 |
+
],
|
1057 |
+
"source": [
|
1058 |
+
"%%time\n",
|
1059 |
+
"tts_ds.push_to_hub(\"yashnbx/gita_supersite_sanskrit_tts\")"
|
1060 |
+
]
|
1061 |
+
},
|
1062 |
+
{
|
1063 |
+
"cell_type": "code",
|
1064 |
+
"execution_count": null,
|
1065 |
+
"id": "2a7f8813",
|
1066 |
+
"metadata": {},
|
1067 |
+
"outputs": [],
|
1068 |
+
"source": []
|
1069 |
+
},
|
1070 |
+
{
|
1071 |
+
"cell_type": "code",
|
1072 |
+
"execution_count": null,
|
1073 |
+
"id": "4f8868fc",
|
1074 |
+
"metadata": {},
|
1075 |
+
"outputs": [],
|
1076 |
+
"source": []
|
1077 |
+
}
|
1078 |
+
],
|
1079 |
+
"metadata": {
|
1080 |
+
"kernelspec": {
|
1081 |
+
"display_name": "Python 3 (ipykernel)",
|
1082 |
+
"language": "python",
|
1083 |
+
"name": "python3"
|
1084 |
+
},
|
1085 |
+
"language_info": {
|
1086 |
+
"codemirror_mode": {
|
1087 |
+
"name": "ipython",
|
1088 |
+
"version": 3
|
1089 |
+
},
|
1090 |
+
"file_extension": ".py",
|
1091 |
+
"mimetype": "text/x-python",
|
1092 |
+
"name": "python",
|
1093 |
+
"nbconvert_exporter": "python",
|
1094 |
+
"pygments_lexer": "ipython3",
|
1095 |
+
"version": "3.10.13"
|
1096 |
+
}
|
1097 |
+
},
|
1098 |
+
"nbformat": 4,
|
1099 |
+
"nbformat_minor": 5
|
1100 |
+
}
|