ai-hr / app.py
ruv's picture
Update app.py
c4dd5c1 verified
raw
history blame contribute delete
No virus
4.88 kB
import gradio as gr
import pandas as pd
# Demo Data
employee_data = {
"Name": ["Alice Smith", "Bob Johnson", "Charlie Davis"],
"Role": ["Case Worker", "Program Manager", "Data Analyst"],
"Performance Score": [85, 90, 95],
"Engagement Score": [88, 85, 92],
"Years of Service": [3, 5, 2],
"Languages Spoken": ["English, Spanish", "English, French", "English, Mandarin"]
}
recruitment_data = {
"Candidate Name": ["John Doe", "Jane Roe", "Jim Poe"],
"Applied Position": ["Community Outreach Coordinator", "Volunteer Coordinator", "Fundraising Specialist"],
"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")
gr.Markdown("### Performance Metrics")
gr.DataFrame(value=employee_df[['Name', 'Performance Score']], label="Performance Data")
gr.Markdown("### Performance Planning")
gr.Markdown("- Setting SMART goals and regular performance reviews​``【oaicite:2】``​.")
gr.Markdown("### Training and Development Plans")
gr.Markdown("Identify training needs and track progress on development plans.")
with gr.TabItem("Engagement and Sentiment Analysis"):
gr.Markdown("## Engagement and Sentiment Analysis")
gr.Markdown("### Engagement Scores")
gr.DataFrame(value=employee_df[['Name', 'Engagement Score']], label="Engagement Data")
gr.Markdown("### Sentiment Analysis")
gr.Markdown("Analyze employee feedback to identify trends​``【oaicite:1】``​.")
with gr.TabItem("Learning and Development"):
gr.Markdown("## Learning and Development")
gr.Markdown("### Personalized Learning Paths")
gr.Markdown("- Alice Smith: Advanced Case Management Training")
gr.Markdown("- Bob Johnson: Leadership and Management Training")
gr.Markdown("- Charlie Davis: Data Analytics and Reporting Workshop")
gr.Markdown("### Skill Gap Analysis")
gr.Markdown("Identify and address skill gaps within the workforce.")
gr.Markdown("### Language Training")
gr.Markdown("Offer language courses to enhance communication with diverse immigrant communities.")
with gr.TabItem("Admin and Compliance"):
gr.Markdown("## Admin and Compliance")
gr.Markdown("### Recent Activities")
gr.Markdown("No recent activities.")
gr.Markdown("### Compliance Checklist")
gr.Markdown("- Adherence to employment standards, health and safety regulations, and human rights laws​``【oaicite:0】``​.")
gr.Markdown("### Documentation")
gr.Markdown("Ensure all employee and organizational documents are up-to-date and comply with regulations.")
with gr.TabItem("Programs and Initiatives"):
gr.Markdown("## Programs and Initiatives")
gr.Markdown("### Ongoing Projects")
gr.Markdown("- Community Outreach Program: Engaging local communities to support immigrants.")
gr.Markdown("- Volunteer Program: Coordinating volunteer efforts to assist with service delivery.")
gr.Markdown("- Fundraising Campaign: Raising funds to support organizational goals and services.")
gr.Markdown("### Success Stories")
gr.Markdown("Highlight success stories of immigrants who have benefited from the programs.")
demo.launch()