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