File size: 2,996 Bytes
0f9f621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
import pandas as pd

# Demo Data
employee_data = {
    "Name": ["Alice Smith", "Bob Johnson", "Charlie Davis"],
    "Role": ["Software Engineer", "Product Manager", "Data Scientist"],
    "Performance Score": [85, 90, 95],
    "Engagement Score": [88, 85, 92]
}

recruitment_data = {
    "Candidate Name": ["John Doe", "Jane Roe", "Jim Poe"],
    "Applied Position": ["DevOps Engineer", "UX Designer", "Backend Developer"],
    "Status": ["Interview Scheduled", "Under Review", "Offer Extended"]
}

# Convert to DataFrames
employee_df = pd.DataFrame(employee_data)
recruitment_df = pd.DataFrame(recruitment_data)

# Functions to display data
def display_employee_data():
    return employee_df

def display_recruitment_data():
    return recruitment_df

# Create Gradio Interface
with gr.Blocks() as demo:
    with gr.Tabs():
        with gr.TabItem("Dashboard"):
            gr.Markdown("## HR System Dashboard")
            with gr.Row():
                gr.Markdown("### Key Metrics")
                gr.Markdown("Total Employees: 3")
                gr.Markdown("Average Performance Score: 90")
                gr.Markdown("Average Engagement Score: 88.33")

        with gr.TabItem("Employee Management"):
            gr.Markdown("## Employee Management")
            employee_table = gr.DataFrame(value=employee_df, label="Employee Data")
            refresh_button = gr.Button("Refresh Data")
            refresh_button.click(display_employee_data, outputs=employee_table)

        with gr.TabItem("Recruitment"):
            gr.Markdown("## Recruitment")
            recruitment_table = gr.DataFrame(value=recruitment_df, label="Recruitment Data")
            refresh_button = gr.Button("Refresh Data")
            refresh_button.click(display_recruitment_data, outputs=recruitment_table)

        with gr.TabItem("Performance Tracking"):
            gr.Markdown("## Performance Tracking")
            with gr.Row():
                gr.Markdown("### Employee Performance")
                gr.DataFrame(value=employee_df[['Name', 'Performance Score']], label="Performance Data")

        with gr.TabItem("Engagement and Sentiment Analysis"):
            gr.Markdown("## Engagement and Sentiment Analysis")
            with gr.Row():
                gr.Markdown("### Employee Engagement")
                gr.DataFrame(value=employee_df[['Name', 'Engagement Score']], label="Engagement Data")

        with gr.TabItem("Learning and Development"):
            gr.Markdown("## Learning and Development")
            gr.Markdown("### Personalized Learning Paths")
            gr.Markdown("- Alice Smith: Advanced Python Course")
            gr.Markdown("- Bob Johnson: Leadership Training")
            gr.Markdown("- Charlie Davis: Machine Learning Workshop")

        with gr.TabItem("Admin and Compliance"):
            gr.Markdown("## Admin and Compliance")
            gr.Markdown("### Recent Activities")
            gr.Markdown("No recent activities.")

demo.launch()