nreimers commited on
Commit
a005378
·
1 Parent(s): 9c83d45
Files changed (5) hide show
  1. README.md +3 -0
  2. prepare.py +36 -0
  3. subjects-questions.csv +3 -0
  4. test.jsonl +3 -0
  5. train.jsonl +3 -0
README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ This is the [IITJEE NEET AIIMS Students Questions Data](https://www.kaggle.com/mrutyunjaybiswal/iitjee-neet-aims-students-questions-data) dataset.
2
+
3
+ It categorizes university entry questions into 4 categories: Physics, Chemistry, Biology, and Mathematics.
prepare.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ from collections import Counter
3
+ import json
4
+ import random
5
+
6
+ df = pd.read_csv("subjects-questions.csv")
7
+ df.fillna('', inplace=True)
8
+ print(df)
9
+
10
+ label2id = {label: idx for idx, label in enumerate(df['Subject'].unique())}
11
+
12
+
13
+ rows = [{'text': row['eng'].strip(),
14
+ 'label': label2id[row['Subject']],
15
+ 'label_text': row['Subject'],
16
+ } for idx, row in df.iterrows()]
17
+
18
+ random.seed(42)
19
+ random.shuffle(rows)
20
+
21
+ num_test = 5000
22
+ splits = {'test': rows[0:num_test], 'train': rows[num_test:]}
23
+
24
+ print("Train:", len(splits['train']))
25
+ print("Test:", len(splits['test']))
26
+
27
+ num_labels = Counter()
28
+
29
+ for row in splits['test']:
30
+ num_labels[row['label']] += 1
31
+ print(num_labels)
32
+
33
+ for split in ['train', 'test']:
34
+ with open(f'{split}.jsonl', 'w') as fOut:
35
+ for row in splits[split]:
36
+ fOut.write(json.dumps(row)+"\n")
subjects-questions.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32851443914ada50478e5b719258658af9d1611a5f91132a043e4cb62129c1df
3
+ size 29900009
test.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bd48a150707c9403060890a91250f1062029ad7da508e97a6eb9fbd1e43615b
3
+ size 1486095
train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29433647a7a923c107f45794b94211504353889bb5cf8bab0d80aaccf4fcef9c
3
+ size 35034578