File size: 2,691 Bytes
2f04ad1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from transformers import pipeline
import gradio as gr

def recommend_training(employee_name, technical_competence, behavioral_competence, feedback):
    data_analysis_skills = (technical_competence + behavioral_competence) / 2
    
    if data_analysis_skills >= 4.5:
        recommendation = f"Congratulations {employee_name}! Your data analysis skills are exceptional. Keep leveraging tools like Power BI to visualize insights and consider advanced courses in statistical analysis. For more information, check out these resources: [Advanced Statistical Analysis Course](https://example.com/statistical-analysis-course), [Power BI Documentation](https://docs.microsoft.com/en-us/power-bi/)."
    elif 3.5 <= data_analysis_skills < 4.5:
        recommendation = f"Well done {employee_name}! Your data analysis skills are good. Consider diving deeper into Power BI functionalities and attending workshops on data storytelling. For more information, check out these resources: [Power BI Workshops](https://example.com/power-bi-workshops), [Data Storytelling Guide](https://example.com/data-storytelling-guide)."
    elif 2.5 <= data_analysis_skills < 3.5:
        recommendation = f"{employee_name}, there's room for improvement in your data analysis skills. We recommend focusing on mastering Power BI for more advanced data visualization techniques. For more information, check out these resources: [Mastering Power BI Course](https://example.com/power-bi-course), [Data Visualization Best Practices](https://example.com/data-visualization-best-practices)."
    else:
        recommendation = f"{employee_name}, your data analysis skills need significant improvement. We suggest enrolling in comprehensive training programs covering Power BI and basic statistical analysis. For more information, check out these resources: [Comprehensive Power BI Training](https://example.com/power-bi-training), [Basic Statistical Analysis Course](https://example.com/statistical-analysis-course)."
    return recommendation

# Creating Gradio interface
interface = gr.Interface(
    fn=recommend_training,
    inputs=[
        gr.Textbox(label="Employee Name"),
        gr.Slider(minimum=0, maximum=5, label="Technical Competence (out of 5)"),
        gr.Slider(minimum=0, maximum=5, label="Behavioral Competence (out of 5)"),
        gr.Textbox(label="Appraisee and Manager's Feedback")
    ],
    outputs=gr.Textbox(label="Recommendation"),
    title="Data Analyst Performance Recommendation Engine",
    description="Enter the Data Analyst's name, technical competence, behavioral competence, and appraisee and manager's feedback to receive recommendations for the next quarter.",
)

interface.launch()