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()