ruv commited on
Commit
0f9f621
1 Parent(s): 4297141

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +76 -0
app.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pandas as pd
3
+
4
+ # Demo Data
5
+ employee_data = {
6
+ "Name": ["Alice Smith", "Bob Johnson", "Charlie Davis"],
7
+ "Role": ["Software Engineer", "Product Manager", "Data Scientist"],
8
+ "Performance Score": [85, 90, 95],
9
+ "Engagement Score": [88, 85, 92]
10
+ }
11
+
12
+ recruitment_data = {
13
+ "Candidate Name": ["John Doe", "Jane Roe", "Jim Poe"],
14
+ "Applied Position": ["DevOps Engineer", "UX Designer", "Backend Developer"],
15
+ "Status": ["Interview Scheduled", "Under Review", "Offer Extended"]
16
+ }
17
+
18
+ # Convert to DataFrames
19
+ employee_df = pd.DataFrame(employee_data)
20
+ recruitment_df = pd.DataFrame(recruitment_data)
21
+
22
+ # Functions to display data
23
+ def display_employee_data():
24
+ return employee_df
25
+
26
+ def display_recruitment_data():
27
+ return recruitment_df
28
+
29
+ # Create Gradio Interface
30
+ with gr.Blocks() as demo:
31
+ with gr.Tabs():
32
+ with gr.TabItem("Dashboard"):
33
+ gr.Markdown("## HR System Dashboard")
34
+ with gr.Row():
35
+ gr.Markdown("### Key Metrics")
36
+ gr.Markdown("Total Employees: 3")
37
+ gr.Markdown("Average Performance Score: 90")
38
+ gr.Markdown("Average Engagement Score: 88.33")
39
+
40
+ with gr.TabItem("Employee Management"):
41
+ gr.Markdown("## Employee Management")
42
+ employee_table = gr.DataFrame(value=employee_df, label="Employee Data")
43
+ refresh_button = gr.Button("Refresh Data")
44
+ refresh_button.click(display_employee_data, outputs=employee_table)
45
+
46
+ with gr.TabItem("Recruitment"):
47
+ gr.Markdown("## Recruitment")
48
+ recruitment_table = gr.DataFrame(value=recruitment_df, label="Recruitment Data")
49
+ refresh_button = gr.Button("Refresh Data")
50
+ refresh_button.click(display_recruitment_data, outputs=recruitment_table)
51
+
52
+ with gr.TabItem("Performance Tracking"):
53
+ gr.Markdown("## Performance Tracking")
54
+ with gr.Row():
55
+ gr.Markdown("### Employee Performance")
56
+ gr.DataFrame(value=employee_df[['Name', 'Performance Score']], label="Performance Data")
57
+
58
+ with gr.TabItem("Engagement and Sentiment Analysis"):
59
+ gr.Markdown("## Engagement and Sentiment Analysis")
60
+ with gr.Row():
61
+ gr.Markdown("### Employee Engagement")
62
+ gr.DataFrame(value=employee_df[['Name', 'Engagement Score']], label="Engagement Data")
63
+
64
+ with gr.TabItem("Learning and Development"):
65
+ gr.Markdown("## Learning and Development")
66
+ gr.Markdown("### Personalized Learning Paths")
67
+ gr.Markdown("- Alice Smith: Advanced Python Course")
68
+ gr.Markdown("- Bob Johnson: Leadership Training")
69
+ gr.Markdown("- Charlie Davis: Machine Learning Workshop")
70
+
71
+ with gr.TabItem("Admin and Compliance"):
72
+ gr.Markdown("## Admin and Compliance")
73
+ gr.Markdown("### Recent Activities")
74
+ gr.Markdown("No recent activities.")
75
+
76
+ demo.launch()