File size: 4,459 Bytes
a59c712
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from Backend import process_and_generate_report  # Import backend functions

with gr.Blocks() as iface:
    gr.Markdown("## <div style='text-align: center;'>AI-DRIVEN DROPOUT PREDICTION AND PREVENTION TOOL</div>")

    with gr.Row():
        with gr.Column():
            inputs = {}

            gr.Markdown("### Basic Information")
            with gr.Row():
                inputs["roll_no"] = gr.Textbox(label="Roll No", value="7376211CS203")
                inputs["semester"] = gr.Dropdown(label="Semester", choices=["I", "II", "III", "IV", "V", "VI", "VII", "VIII"], value="VIII", interactive=True)

            gr.Markdown("### Degree Information")
            inputs["degree"] = gr.Dropdown(label="Degree", choices=[
                "B.E. - ELECTRONICS AND INSTRUMENTATION ENGINEERING",
                "B.E. - ELECTRONICS AND COMMUNICATION ENGINEERING",
                "B.E. - ELECTRICAL AND ELECTRONICS ENGINEERING",
                "B.E. - COMPUTER SCIENCE AND ENGINEERING",
                "B.E. - MECHANICAL ENGINEERING",
                "B.E. - MECHATRONICS ENGINEERING",
                "B.Tech. - AGRICULTURAL ENGINEERING",
                "B.Tech. - ARTIFICIAL INTELLIGENCE AND DATA SCIENCE",
                "B.Tech. - ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING",
                "B.Tech. - COMPUTER SCIENCE AND BUSINESS SYSTEMS",
                "B.Tech. - INFORMATION TECHNOLOGY","B.Tech. - BIOTECHNOLOGY",
            ], value="B.E. - COMPUTER SCIENCE AND ENGINEERING", interactive=True)

            inputs["special_lab"] = gr.Dropdown(label="Special Lab", choices=["Active", "Non-Active"], value="Non-Active", interactive=True)

            gr.Markdown("### Academic Performance")
            with gr.Row():
                inputs["attendance_percentage"] = gr.Number(label="Attendance Percentage", minimum=0, maximum=100, value=90)
                inputs["formative_assessment"] = gr.Number(label="Formative Assessment (Academic %)", minimum=0, maximum=100, value=50)

            with gr.Row():
                inputs["cgpa"] = gr.Number(label="CGPA", minimum=0, maximum=10, value=8.0)
                inputs["current_sgpa"] = gr.Number(label="Current SGPA", minimum=0, maximum=10, value=7.5)
                inputs["arrear_count"] = gr.Number(label="Arrear Count", minimum=0, maximum=48, value=1)

            gr.Markdown("### Placement and Assessments")
            with gr.Row():
                inputs["placement_fa"] = gr.Number(label="Placement FA %", minimum=0, maximum=100, value=50)
                inputs["placement_cumulative"] = gr.Number(label="Placement Cumulative", minimum=0, maximum=100, value=60)
                inputs["placement_Attendence"] = gr.Number(label="Placement Attendance", minimum=0, maximum=100, value=70)
                inputs["interim_assessment_status"] = gr.Number(label="Interim Assessment Status", minimum=0, maximum=100, value=70)
                inputs["training_assessment_status"] = gr.Number(label="Training Assessment Status", minimum=0, maximum=100, value=75)
                inputs["mock_assessment_status"] = gr.Number(label="Mock Assessment Status", minimum=0, maximum=100, value=80)

            gr.Markdown("### Skill Rankings")
            with gr.Row():
                inputs["full_stack_rank"] = gr.Number(label="Full Stack Rank", minimum=0, maximum=1700, value=850)
                inputs["ps_rank"] = gr.Number(label="PS Level Completed", minimum=0, maximum=30, value=3)
                inputs["Overall_Skills_Acquired"] = gr.Number(label="Total Skills Acquired", value=7)

            gr.Markdown("### Extracurricular Activities")
            with gr.Row():
                for key in ["Technical_Competition", "Paper_Presentation", "Project_Competition", "Product_Development", "Patent", "Internship", "Online_Course"]:
                    inputs[key] = gr.Number(label=key.replace("_", " ").title(), value=0)

            submit = gr.Button("Predict Dropout")

        with gr.Column():
            gr.Markdown("### Prediction Output")
            output_plot = gr.Plot(label="Dropout Risk Graph")
            summary = gr.Textbox(label="Final Summary")
            download_btn = gr.File(label="Download Report", interactive=False)

    submit.click(
        lambda *args: process_and_generate_report(**dict(zip(inputs.keys(), args))),
        inputs=list(inputs.values()),
        outputs=[output_plot, summary, download_btn]
    )

iface.launch()