Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,40 +3,89 @@ import gradio as gr
|
|
3 |
# Hardcoded NEET cutoff data for top 10 medical colleges in India (example data) by reservation category
|
4 |
colleges_data = {
|
5 |
"All India Institute of Medical Sciences (AIIMS) Delhi": {
|
6 |
-
"
|
7 |
-
"
|
8 |
-
"
|
|
|
9 |
},
|
10 |
"Maulana Azad Medical College (MAMC) Delhi": {
|
11 |
-
"
|
12 |
-
"
|
13 |
-
"
|
|
|
14 |
},
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
-
# Function to calculate eligible colleges based on NEET score
|
19 |
-
def neet_cutoff_calculator(score,
|
20 |
eligible_colleges = []
|
21 |
for college, cutoffs in colleges_data.items():
|
22 |
-
|
23 |
-
|
|
|
24 |
return eligible_colleges
|
25 |
|
26 |
# Function for Gradio interface
|
27 |
-
def calculate_colleges(score,
|
28 |
-
eligible_colleges = neet_cutoff_calculator(score,
|
29 |
if eligible_colleges:
|
30 |
return f"With a score of {score}, you are eligible for admission to the following colleges: {', '.join(eligible_colleges)}"
|
31 |
else:
|
32 |
-
return "Unfortunately, no colleges match your score for the selected
|
33 |
|
34 |
# Create the Gradio interface using the updated syntax
|
35 |
iface = gr.Interface(
|
36 |
fn=calculate_colleges,
|
37 |
inputs=[
|
38 |
gr.Slider(0, 720, label="NEET Score"),
|
39 |
-
gr.Dropdown(["2023", "2022", "2021"], label="Year"),
|
40 |
gr.Dropdown(["GEN", "OBC", "SC", "ST"], label="Category")
|
41 |
],
|
42 |
outputs="text",
|
|
|
3 |
# Hardcoded NEET cutoff data for top 10 medical colleges in India (example data) by reservation category
|
4 |
colleges_data = {
|
5 |
"All India Institute of Medical Sciences (AIIMS) Delhi": {
|
6 |
+
"GEN": [705, 700, 705],
|
7 |
+
"OBC": [685, 680, 685],
|
8 |
+
"SC": [675, 670, 675],
|
9 |
+
"ST": [670, 665, 670],
|
10 |
},
|
11 |
"Maulana Azad Medical College (MAMC) Delhi": {
|
12 |
+
"GEN": [690, 685, 690],
|
13 |
+
"OBC": [675, 670, 675],
|
14 |
+
"SC": [665, 660, 665],
|
15 |
+
"ST": [660, 655, 660],
|
16 |
},
|
17 |
+
"Christian Medical College (CMC) Vellore": {
|
18 |
+
"GEN": [675, 670, 675],
|
19 |
+
"OBC": [660, 655, 660],
|
20 |
+
"SC": [650, 645, 650],
|
21 |
+
"ST": [645, 640, 645],
|
22 |
+
},
|
23 |
+
"King George's Medical University (KGMU) Lucknow": {
|
24 |
+
"GEN": [665, 660, 665],
|
25 |
+
"OBC": [650, 645, 650],
|
26 |
+
"SC": [640, 635, 640],
|
27 |
+
"ST": [635, 630, 635],
|
28 |
+
},
|
29 |
+
"Jawaharlal Institute of Postgraduate Medical Education & Research (JIPMER) Puducherry": {
|
30 |
+
"GEN": [670, 665, 670],
|
31 |
+
"OBC": [655, 650, 655],
|
32 |
+
"SC": [645, 640, 645],
|
33 |
+
"ST": [640, 635, 640],
|
34 |
+
},
|
35 |
+
"Grant Medical College Mumbai": {
|
36 |
+
"GEN": [655, 650, 655],
|
37 |
+
"OBC": [640, 635, 640],
|
38 |
+
"SC": [630, 625, 630],
|
39 |
+
"ST": [625, 620, 625],
|
40 |
+
},
|
41 |
+
"Seth GS Medical College Mumbai": {
|
42 |
+
"GEN": [660, 655, 660],
|
43 |
+
"OBC": [645, 640, 645],
|
44 |
+
"SC": [635, 630, 635],
|
45 |
+
"ST": [630, 625, 630],
|
46 |
+
},
|
47 |
+
"Banaras Hindu University (BHU) Varanasi": {
|
48 |
+
"GEN": [675, 670, 675],
|
49 |
+
"OBC": [660, 655, 660],
|
50 |
+
"SC": [650, 645, 650],
|
51 |
+
"ST": [645, 640, 645],
|
52 |
+
},
|
53 |
+
"Lady Hardinge Medical College (LHMC) Delhi": {
|
54 |
+
"GEN": [680, 675, 680],
|
55 |
+
"OBC": [665, 660, 665],
|
56 |
+
"SC": [655, 650, 655],
|
57 |
+
"ST": [650, 645, 650],
|
58 |
+
},
|
59 |
+
"University College of Medical Sciences (UCMS) Delhi": {
|
60 |
+
"GEN": [685, 680, 685],
|
61 |
+
"OBC": [670, 665, 670],
|
62 |
+
"SC": [660, 655, 660],
|
63 |
+
"ST": [655, 650, 655],
|
64 |
+
}
|
65 |
}
|
66 |
|
67 |
+
# Function to calculate eligible colleges based on NEET score and reservation category
|
68 |
+
def neet_cutoff_calculator(score, category):
|
69 |
eligible_colleges = []
|
70 |
for college, cutoffs in colleges_data.items():
|
71 |
+
average_cutoff = sum(cutoffs[category]) / len(cutoffs[category])
|
72 |
+
if score >= average_cutoff:
|
73 |
+
eligible_colleges.append(f"{college} (Avg Cutoff: {average_cutoff:.2f})")
|
74 |
return eligible_colleges
|
75 |
|
76 |
# Function for Gradio interface
|
77 |
+
def calculate_colleges(score, category):
|
78 |
+
eligible_colleges = neet_cutoff_calculator(score, category)
|
79 |
if eligible_colleges:
|
80 |
return f"With a score of {score}, you are eligible for admission to the following colleges: {', '.join(eligible_colleges)}"
|
81 |
else:
|
82 |
+
return "Unfortunately, no colleges match your score for the selected category."
|
83 |
|
84 |
# Create the Gradio interface using the updated syntax
|
85 |
iface = gr.Interface(
|
86 |
fn=calculate_colleges,
|
87 |
inputs=[
|
88 |
gr.Slider(0, 720, label="NEET Score"),
|
|
|
89 |
gr.Dropdown(["GEN", "OBC", "SC", "ST"], label="Category")
|
90 |
],
|
91 |
outputs="text",
|