Spaces:
Sleeping
Sleeping
| from sentence_transformers import SentenceTransformer | |
| from sklearn.metrics.pairwise import cosine_similarity | |
| import gradio as gr | |
| st = SentenceTransformer('all-mpnet-base-v2') | |
| def predict(exp, listOfPosition, major_applicant, skills_applicant, yoe, jobdesc, rolename, major_vacancy, skills_vacancy, minimumYoe): | |
| diffYoe = yoe - minimumYoe | |
| results = {} | |
| results['score'] = 0.6 | |
| results['is_accepted'] = True | |
| return results | |
| with gr.Blocks() as app: | |
| with gr.Row(): | |
| with gr.Column(): | |
| gr.Markdown("### Applicant Details") | |
| exp = gr.Textbox(label="Experience") | |
| listOfPosition = gr.Textbox(label="List of Positions") | |
| major_applicant = gr.Textbox(label="Major") | |
| skills_applicant = gr.Textbox(label="Skills") | |
| yoe = gr.Number(label="Years of Experience", precision=0) | |
| with gr.Column(): | |
| gr.Markdown("### Vacancy Details") | |
| jobdesc = gr.Textbox(label="Job Description") | |
| rolename = gr.Textbox(label="Role Name") | |
| major_vacancy = gr.Textbox(label="Major Required") | |
| skills_vacancy = gr.Textbox(label="Skills Required") | |
| minimumYoe = gr.Number(label="Minimum Years of Experience", precision=0) | |
| gr.Button("Submit Application").click( | |
| predict, | |
| inputs=[exp, listOfPosition, major_applicant, skills_applicant, yoe, jobdesc, rolename, major_vacancy, skills_vacancy, minimumYoe], | |
| outputs=gr.JSON(label="Result") | |
| ) | |
| if __name__ == "__main__": | |
| app.launch(debug=True) | |