applied-ai-018 commited on
Commit
1806d5f
·
verified ·
1 Parent(s): 0570ec1

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. convert.py +62 -0
  2. convert.sh +6 -0
  3. debug.err +0 -0
  4. download.py +12 -0
  5. download.sh +5 -0
  6. verified/dataset_dict.json +1 -0
  7. verified/train/data-00000-of-00197.arrow +3 -0
  8. verified/train/data-00001-of-00197.arrow +3 -0
  9. verified/train/data-00002-of-00197.arrow +3 -0
  10. verified/train/data-00003-of-00197.arrow +3 -0
  11. verified/train/data-00004-of-00197.arrow +3 -0
  12. verified/train/data-00006-of-00197.arrow +3 -0
  13. verified/train/data-00008-of-00197.arrow +3 -0
  14. verified/train/data-00009-of-00197.arrow +3 -0
  15. verified/train/data-00010-of-00197.arrow +3 -0
  16. verified/train/data-00011-of-00197.arrow +3 -0
  17. verified/train/data-00012-of-00197.arrow +3 -0
  18. verified/train/data-00013-of-00197.arrow +3 -0
  19. verified/train/data-00015-of-00197.arrow +3 -0
  20. verified/train/data-00018-of-00197.arrow +3 -0
  21. verified/train/data-00019-of-00197.arrow +3 -0
  22. verified/train/data-00020-of-00197.arrow +3 -0
  23. verified/train/data-00021-of-00197.arrow +3 -0
  24. verified/train/data-00022-of-00197.arrow +3 -0
  25. verified/train/data-00024-of-00197.arrow +3 -0
  26. verified/train/data-00026-of-00197.arrow +3 -0
  27. verified/train/data-00027-of-00197.arrow +3 -0
  28. verified/train/data-00028-of-00197.arrow +3 -0
  29. verified/train/data-00030-of-00197.arrow +3 -0
  30. verified/train/data-00032-of-00197.arrow +3 -0
  31. verified/train/data-00033-of-00197.arrow +3 -0
  32. verified/train/data-00034-of-00197.arrow +3 -0
  33. verified/train/data-00036-of-00197.arrow +3 -0
  34. verified/train/data-00037-of-00197.arrow +3 -0
  35. verified/train/data-00038-of-00197.arrow +3 -0
  36. verified/train/data-00040-of-00197.arrow +3 -0
  37. verified/train/data-00041-of-00197.arrow +3 -0
  38. verified/train/data-00042-of-00197.arrow +3 -0
  39. verified/train/data-00043-of-00197.arrow +3 -0
  40. verified/train/data-00044-of-00197.arrow +3 -0
  41. verified/train/data-00045-of-00197.arrow +3 -0
  42. verified/train/data-00046-of-00197.arrow +3 -0
  43. verified/train/data-00047-of-00197.arrow +3 -0
  44. verified/train/data-00048-of-00197.arrow +3 -0
  45. verified/train/data-00049-of-00197.arrow +3 -0
  46. verified/train/data-00050-of-00197.arrow +3 -0
  47. verified/train/data-00051-of-00197.arrow +3 -0
  48. verified/train/data-00052-of-00197.arrow +3 -0
  49. verified/train/data-00053-of-00197.arrow +3 -0
  50. verified/train/data-00054-of-00197.arrow +3 -0
convert.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #import datasets
2
+ #from datasets import load_from_disk
3
+ #
4
+ #data_path="./verified/train"
5
+ #dataset = load_from_disk(data_path)
6
+ #for split, split_dataset in dataset.items():
7
+ # split_dataset.to_json(f"squad-{split}.jsonl")
8
+
9
+ import pyarrow as pa
10
+ import pyarrow.parquet as pq
11
+ import pandas as pd
12
+ import json
13
+ import sys
14
+ import os
15
+
16
+ def arrow_to_json(arrow_file_path, json_file_path):
17
+ # Read the Arrow file into a Table
18
+ print(arrow_file_path, json_file_path)
19
+ table = pa.ipc.open_file(arrow_file_path).read_all()
20
+
21
+ # Convert Table to a Pandas DataFrame
22
+ df = table.to_pandas()
23
+
24
+ # Convert DataFrame to JSON format
25
+ json_data = df.to_json(orient='records')
26
+
27
+ # Write JSON data to a file
28
+ with open(json_file_path, 'w') as json_file:
29
+ json_file.write(json_data)
30
+
31
+ print(f"Converted '{arrow_file_path}' to '{json_file_path}' successfully.")
32
+
33
+ def get_files_with_extension(directory, extension):
34
+ # Ensure the extension starts with a dot
35
+ if not extension.startswith('.'):
36
+ extension = '.' + extension
37
+
38
+ # List all files in the directory
39
+ all_files = os.listdir(directory)
40
+
41
+ # Filter files with the given extension
42
+ filtered_files = [f for f in all_files if f.endswith(extension)]
43
+
44
+ return filtered_files
45
+
46
+
47
+ arrow_file_dir = "./verified/train/"
48
+ extension = ".arrow"
49
+ arrow_files = get_files_with_extension(arrow_file_dir , extension)
50
+ json_dir = "./verified/json/"
51
+ os.mkdir(json_dir)
52
+ for f in arrow_files:
53
+ arrow_to_json(arrow_file_dir + f, json_dir + f + ".json")
54
+ # arrow_to_json(f , json_dir)
55
+ #if __name__ == "__main__":
56
+ # if len(sys.argv) != 3:
57
+ # print("Usage: python script.py <input.arrow> <output.json>")
58
+ # else:
59
+ # arrow_file_path = sys.argv[1]
60
+ # json_file_path = sys.argv[2]
61
+ # arrow_to_json(arrow_file_path, json_file_path)
62
+
convert.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ set -x
4
+ cd /mnt/weka/peacock/peacock-data/sangraha
5
+ rm -rf verified/json
6
+ python3 convert.py 2> debug.err
debug.err ADDED
The diff for this file is too large to render. See raw diff
 
download.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from datasets import load_dataset
2
+
3
+ dataset_ver = load_dataset("ai4bharat/sangraha", data_dir = 'verified/hin')
4
+
5
+ for split, split_dataset in dataset_ver.items():
6
+ split_dataset.to_json(f"/mnt/weka/peacock/peacock-data/sangraha/verified/ver-{split}.jsonl")
7
+ dataset_ver.save_to_disk("/mnt/weka/peacock/peacock-data/sangraha/verified")
8
+
9
+ dataset_unver = load_dataset("ai4bharat/sangraha", data_dir = 'unverified/hin')
10
+ dataset_unver.save_to_disk("/mnt/weka/peacock/peacock-data/sangraha/unverified")
11
+ for split, split_dataset in dataset_unver.items():
12
+ split_dataset.to_json(f"/mnt/weka/peacock/peacock-data/sangraha/unverified/unver-{split}.jsonl")
download.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ set -x
4
+ cd /mnt/weka/peacock/peacock-data/sangraha
5
+ python3 download.py 2> debug.err
verified/dataset_dict.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"splits": ["train"]}
verified/train/data-00000-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12e14e1fa0dd2ec4051bb7af6cd60b233c869a7b955dbc5c852ad02442cc007d
3
+ size 504592200
verified/train/data-00001-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b043f71f12ce88b56dff0892a02e109aa0ae65fe5bf9baa92725c4d911fd30a6
3
+ size 500551024
verified/train/data-00002-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ad4b0b6cbfa194c53d42812234dad8be0b260a5284423d31d96eb2244d69e13c
3
+ size 498543248
verified/train/data-00003-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c7942099b5777e1f3a263928db10419f289215f99ab254a2e40e60b8eca4dbf
3
+ size 496021600
verified/train/data-00004-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee7b447aabcff9036170091d72bf227a6e0456d4421d471b2622716716c61a57
3
+ size 499812544
verified/train/data-00006-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:336a414e20ed40490cc174840c8eec0a5a544d6c41d0d56a75e74ee8817dec95
3
+ size 498167000
verified/train/data-00008-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14e64adbd20110ede74209cafc1a644edd80617f2f45318d72b62c26a3bd4181
3
+ size 497880928
verified/train/data-00009-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e9a3f02fc36091dcb90dfd47636654e88e20d320b5214f4f946d20ba4748066
3
+ size 494448224
verified/train/data-00010-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93b02c570b5f83be91568df7cc96ff876dd5caff557110cb26a2354721c0eecc
3
+ size 491844656
verified/train/data-00011-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5796330f8a89e32aded0d9ad64562c029d443f6dc049f75d5166dcce7d71c02c
3
+ size 497565056
verified/train/data-00012-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e10e50711ce31991332dc09f8f11c11ccc88d4de222976e4a9fd40b74cb0f57
3
+ size 495985136
verified/train/data-00013-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d0bb3bfae2fe4f9799961b6c298fb856366af98bd280d71be6d235c286d2577
3
+ size 499032528
verified/train/data-00015-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7020a65f3c3478cf242a24adfc0fc0fec6f8bc4b4aede569150c4e6a496988aa
3
+ size 496374280
verified/train/data-00018-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3cc08bc0d3179257212a715d6975ed2d12c19fc89b68c490f6d86cf3a8697a28
3
+ size 496480104
verified/train/data-00019-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85e72efb1ffa3387eceb43bc92e6ab9e98f977e7683f4a16db466a71c0a1730a
3
+ size 501222816
verified/train/data-00020-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bd8784fd55c1c8c7315120217bc6004e438d5eb93df979dd5b90fef422acec9
3
+ size 501715736
verified/train/data-00021-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21b8798c412a02c41a8655c2522cb33a619280a4956b86e13fef838476ac0cfd
3
+ size 500469032
verified/train/data-00022-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:370d1d0d306a05230ec3cd62d3c6e2122c4e00454473a42bf3c9d40b3fa02cd4
3
+ size 503890080
verified/train/data-00024-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:030198d90333e3ff93f379c782f75ab3d49d15f2ba30912f4ab607ab56ca86b3
3
+ size 490910840
verified/train/data-00026-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45a511a3c882f8096c60022c44d1b402f453cd486ce56f104fa58e5bfa609da5
3
+ size 500312560
verified/train/data-00027-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ca4232bf10a39f50c14222b7cccc21101f2dfc5076a57d092ebe02ba7421c04
3
+ size 497736000
verified/train/data-00028-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0222bc5bcc0b1f1911c7d94d7b1120c7457d1afea3f64552cc1f627c6b233269
3
+ size 492011552
verified/train/data-00030-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bf7cae6be5388e52aa93e50cb64345045f80fe6d00f48b1bd80e792de776b8e
3
+ size 493191752
verified/train/data-00032-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b646531ecad25ac839ad2ac9d80e0b7a9bd7f57b1a6dd1cce0810998d2a3afe6
3
+ size 501905776
verified/train/data-00033-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35eeb4f256809f854eb0cc55704dc9f76d9cc1cd1b6bc9fe26a2055f1e1bb103
3
+ size 502366656
verified/train/data-00034-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9567ff8464226d7b634f96d548406d9a9b110c522bb4655b6b6b1d103273a3f
3
+ size 495361904
verified/train/data-00036-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8c5c5e1a1e75c563aafd39f95020be059a52d840330962485c16450dba35ac4
3
+ size 497051800
verified/train/data-00037-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a01323867b27a39a8a2e4220edf48ec172f8d1d65fd3df871b0570e3cd65a8c
3
+ size 502441360
verified/train/data-00038-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e714e555ca9ded15d17b93ddb1217ad33618a567d338e9f414bc582c3372b7f
3
+ size 497311224
verified/train/data-00040-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c26247bf5d615c1a86b91dda101830396db6297de69d57c3a64110bf1938443
3
+ size 493278680
verified/train/data-00041-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:909224577ef2cce1823bfac92ac4527f480f3521f3d039eb1a614167488721f4
3
+ size 496787384
verified/train/data-00042-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f42cb5ae4dd55f29631cecd89d8b70e846e31465263774047a80f9834d32e1db
3
+ size 498930120
verified/train/data-00043-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3e11b4c0784f93471d1b0a2ed16bc16b7412e1910603a0bbb510267c6f7b85b
3
+ size 495368136
verified/train/data-00044-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37d3d2c4605e75fc3ebecad2862dd9ad59e687dbf543acf5f06246c536c2b91b
3
+ size 494542792
verified/train/data-00045-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ddf406ff826ab9fc5ea06884bcd406065e6669624603351ee3a4b9580a0b526
3
+ size 499905056
verified/train/data-00046-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39bbc12e49c0771999e390cecfe3840259d14b76972ac7870bfdc0eedb608956
3
+ size 506999712
verified/train/data-00047-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cee1363d0f7bb9ffa41645eb67d06e963028fc6a41f1a3c3704c95461cbab422
3
+ size 497309224
verified/train/data-00048-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e33b11366fdc07eae1a3dd1e42580a59c77ee544591ec2dcc4ea787ff2110cc
3
+ size 503826976
verified/train/data-00049-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f33033d9a8eedb8ea81376e47bc5ea19ccf8206481ac3f39341d8b9702e1047d
3
+ size 494994472
verified/train/data-00050-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb3e44f48f72d8337c2c6243e7577a598250c4a074e8fe04d2381a08149ce15a
3
+ size 493650224
verified/train/data-00051-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a6a1877ee71cc09254180faaabfcce16455b123b78bf2d176f92d234f7bb515
3
+ size 502151696
verified/train/data-00052-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faa712a44a983663aea9fed1698a9a2f26e9daaa7551eafaa3406823147067bb
3
+ size 498082936
verified/train/data-00053-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d89a5192b7f902e4a962c8f8cc8f8ac37e12cc9a521b4bb6f8447a9159fea80
3
+ size 497384272
verified/train/data-00054-of-00197.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81b4d921fd106e49cf1ea8fc41ee16341748a49dd9c27760d18bbffac71a0f1d
3
+ size 497627160