jabil / app.py
cdcvd's picture
Update app.py
683d9b9 verified
raw
history blame
1.44 kB
import gradio as gr
import openai
import os
# Set OpenAI API key
openai.api_key = os.getenv("OPENAI_API_KEY")
def evaluate_resume(resume, job_description):
prompt = f"""
As an experienced Applicant Tracking System (ATS) analyst,
with profound knowledge in technology, software engineering, data science,
and big data engineering, your role involves evaluating resumes against job descriptions.
Recognizing the competitive job market, provide top-notch assistance for resume improvement.
Your goal is to analyze the resume against the given job description,
assign a percentage match based on key criteria, and pinpoint missing keywords accurately.
resume:{resume}
description:{job_description}
I want the response in one single string having the structure
{{"Job Description Match":"%","Missing Keywords":"","Candidate Summary":"","Experience":""}}
"""
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt}
]
)
return response.choices[0].message['content']
iface = gr.Interface(
fn=evaluate_resume,
inputs=[
gr.inputs.Textbox(lines=10, label="Resume"),
gr.inputs.Textbox(lines=10, label="Job Description")
],
outputs="text",
title="Resume Evaluator"
)
iface.launch()