ag2435 commited on
Commit
21828d5
·
1 Parent(s): 0337404

converted all column types to str

Browse files
all2023/val.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e3e5669a6f9f737671ee95f5ec42d1d631137e28cc1760924a4b1e522eb5ba9d
3
- size 275971196
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:791d41446d57c53220d6b9a17324455ec4456c2f99d0a866624ae88707580e7c
3
+ size 276804917
major/test.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9d2d01a0c6d3835c6fec4f9174c1971581f8cbd10e1a08120f04c93e2fbe0a79
3
- size 216912235
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0410cf07331a5a337e268b3cbd516194e67b4d808c33813fc3771076ceac34f8
3
+ size 216928959
major/train.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2ecb217485c67501bc8d1e5ae43119f240e0f5ec661ebcd8d98d94352175aec0
3
- size 863893562
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b9d8350587ecbea3a6ed80e386c2e12f01983c02dc69947f14cdbb3edaba92c
3
+ size 863959698
minor/test.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0f72055a0615d6d4d7e7e7cf9d40662ef26171aca4fbd5179645d3b8cd9af099
3
- size 861471718
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:604e83967f955123d5b1108dc1f033d19254c57974c836b80d3206a9ac381a44
3
+ size 861534750
minor/train.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f4ba98572d5a64fcf6009aaab95cc5d7957572751e5105f20205115b17d4c001
3
- size 3413539435
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8c6a3670aa07476c00783b6478fed26a766f63d077a972052d182b06a2a2980
3
+ size 3413790835
preprocess_all2023.py CHANGED
@@ -91,9 +91,10 @@ for i, original_df in tqdm(enumerate(pd.read_csv(file_path, sep='\t', chunksize=
91
  if df['primary_subfield'].isin(CATEGORY_ALIASES.keys()).sum():
92
  ValueError("IMPLEMENT CODE TO CHANGE CATEGORY_ALIASES ")
93
 
 
94
  if i == 0:
95
- df.to_json(save_path, lines=True, orient="records", indent=2)
96
  else:
97
- df.to_json(save_path, lines=True, orient="records", mode='a', indent=2)
98
 
99
  # %%
 
91
  if df['primary_subfield'].isin(CATEGORY_ALIASES.keys()).sum():
92
  ValueError("IMPLEMENT CODE TO CHANGE CATEGORY_ALIASES ")
93
 
94
+ # convert all columns to string per huggingface requirements
95
  if i == 0:
96
+ df.astype(str).to_json(save_path, lines=True, orient="records", indent=2)
97
  else:
98
+ df.astype(str).to_json(save_path, lines=True, orient="records", mode='a', indent=2)
99
 
100
  # %%
preprocess_major_minor.py CHANGED
@@ -40,18 +40,18 @@ from tqdm import tqdm
40
 
41
  # %%
42
  IGNORED_CATEGOREIES = set([
43
- "atom-ph", "bayes-an", "chao-dyn", "chem-ph", "cmp-lg", "comp-gas", "cond-mat", "dg-ga", "funct-an",
44
- "mtrl-th", "patt-sol", "plasm-ph", "q-alg", "q-bio", "solv-int", "supr-con", "test", "test.dis-nn",
45
- "test.mes-hall", "test.mtrl-sci", "test.soft", "test.stat-mech", "test.str-el", "test.supr-con"
46
  ])
47
  print("number of ignored categories: ", len(IGNORED_CATEGOREIES))
48
  CATEGORY_ALIASES = {
49
- 'math.MP': 'math-ph',
50
- 'stat.TH': 'math.ST',
51
- 'math.IT': 'cs.IT',
52
- 'q-fin.EC': 'econ.GN',
53
- 'cs.SY': 'eess.SY',
54
- 'cs.NA': 'math.NA'
55
  }
56
  print("number of category aliases: ", len(CATEGORY_ALIASES))
57
 
@@ -90,9 +90,10 @@ for i, original_df in tqdm(enumerate(pd.read_json(file_path, lines=True, chunksi
90
  if df['primary_subfield'].isin(CATEGORY_ALIASES.keys()).sum():
91
  ValueError("IMPLEMENT CODE TO CHANGE CATEGORY_ALIASES ")
92
 
 
93
  if i == 0:
94
- df.to_json(save_path, lines=True, orient="records", indent=2)
95
  else:
96
- df.to_json(save_path, lines=True, orient="records", mode='a', indent=2)
97
 
98
  # %%
 
40
 
41
  # %%
42
  IGNORED_CATEGOREIES = set([
43
+ "atom-ph", "bayes-an", "chao-dyn", "chem-ph", "cmp-lg", "comp-gas", "cond-mat", "dg-ga", "funct-an",
44
+ "mtrl-th", "patt-sol", "plasm-ph", "q-alg", "q-bio", "solv-int", "supr-con", "test", "test.dis-nn",
45
+ "test.mes-hall", "test.mtrl-sci", "test.soft", "test.stat-mech", "test.str-el", "test.supr-con"
46
  ])
47
  print("number of ignored categories: ", len(IGNORED_CATEGOREIES))
48
  CATEGORY_ALIASES = {
49
+ 'math.MP': 'math-ph',
50
+ 'stat.TH': 'math.ST',
51
+ 'math.IT': 'cs.IT',
52
+ 'q-fin.EC': 'econ.GN',
53
+ 'cs.SY': 'eess.SY',
54
+ 'cs.NA': 'math.NA'
55
  }
56
  print("number of category aliases: ", len(CATEGORY_ALIASES))
57
 
 
90
  if df['primary_subfield'].isin(CATEGORY_ALIASES.keys()).sum():
91
  ValueError("IMPLEMENT CODE TO CHANGE CATEGORY_ALIASES ")
92
 
93
+ # convert all columns to string per huggingface requirements
94
  if i == 0:
95
+ df.astype(str).to_json(save_path, lines=True, orient="records", indent=2)
96
  else:
97
+ df.astype(str).to_json(save_path, lines=True, orient="records", mode='a', indent=2)
98
 
99
  # %%