Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from sentence_transformers import SentenceTransformer
|
| 2 |
+
from sklearn.metrics.pairwise import cosine_similarity
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
st = SentenceTransformer('all-mpnet-base-v2')
|
| 7 |
+
|
| 8 |
+
def predict(exp, listOfPosition, major_applicant, skills_applicant, yoe, jobdesc, rolename, major_vacancy, skills_vacancy, minimumYoe):
|
| 9 |
+
diffYoe = yoe - minimumYoe
|
| 10 |
+
return diffYoe
|
| 11 |
+
|
| 12 |
+
with gr.Blocks() as app:
|
| 13 |
+
with gr.Row():
|
| 14 |
+
with gr.Column():
|
| 15 |
+
gr.Markdown("### Applicant Details")
|
| 16 |
+
exp = gr.Textbox(label="Experience")
|
| 17 |
+
listOfPosition = gr.Textbox(label="List of Positions")
|
| 18 |
+
major_applicant = gr.Textbox(label="Major")
|
| 19 |
+
skills_applicant = gr.Textbox(label="Skills")
|
| 20 |
+
yoe = gr.Number(label="Years of Experience", precision=0)
|
| 21 |
+
|
| 22 |
+
with gr.Column():
|
| 23 |
+
gr.Markdown("### Vacancy Details")
|
| 24 |
+
jobdesc = gr.Textbox(label="Job Description")
|
| 25 |
+
rolename = gr.Textbox(label="Role Name")
|
| 26 |
+
major_vacancy = gr.Textbox(label="Major Required")
|
| 27 |
+
skills_vacancy = gr.Textbox(label="Skills Required")
|
| 28 |
+
minimumYoe = gr.Number(label="Minimum Years of Experience", precision=0)
|
| 29 |
+
gr.Button("Submit Application").click(
|
| 30 |
+
predict,
|
| 31 |
+
inputs=[exp, listOfPosition, major_applicant, skills_applicant, yoe, jobdesc, rolename, major_vacancy, skills_vacancy, minimumYoe],
|
| 32 |
+
outputs=gr.JSON(label="Result")
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
app.launch(debug=True)
|