Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import os
|
|
| 4 |
from PyPDF2 import PdfReader
|
| 5 |
import google.generativeai as genai
|
| 6 |
from dotenv import load_dotenv
|
|
|
|
| 7 |
|
| 8 |
# Loading the .env keys
|
| 9 |
load_dotenv()
|
|
@@ -22,38 +23,38 @@ def get_pdf_text(pdf_docs):
|
|
| 22 |
for page in pdf_reader.pages:
|
| 23 |
text += page.extract_text()
|
| 24 |
elif doc.name.endswith(".docx"):
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
for para in doc_reader.paragraphs:
|
| 29 |
-
text += para.text + "\n"
|
| 30 |
-
except ImportError:
|
| 31 |
-
st.error("Please make sure you have installed the `python-docx` package.")
|
| 32 |
return text
|
| 33 |
|
| 34 |
# Define input prompts
|
| 35 |
input_prompts = {
|
| 36 |
"evaluate_resume": """
|
| 37 |
-
You are an experienced Technical Human Resource Manager
|
| 38 |
Please share your professional evaluation on whether the candidate's profile aligns with the role.
|
| 39 |
Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
|
|
|
|
| 40 |
""",
|
| 41 |
"improve_skills": """
|
| 42 |
-
You are
|
| 43 |
-
|
| 44 |
Share your insights on the candidate's suitability for the role from an HR perspective.
|
| 45 |
Additionally, offer advice on enhancing the candidate's skills and identify areas where improvement is needed.
|
|
|
|
| 46 |
""",
|
| 47 |
"missing_keywords": """
|
| 48 |
-
You are
|
| 49 |
-
|
| 50 |
-
assess the compatibility of the resume with the role.
|
| 51 |
-
Also, provide recommendations for enhancing the candidate's skills and
|
|
|
|
| 52 |
""",
|
| 53 |
"percentage_match": """
|
| 54 |
-
You are
|
| 55 |
-
|
| 56 |
-
the job description. First the
|
|
|
|
| 57 |
""",
|
| 58 |
"answer_query": """
|
| 59 |
You are an experienced Technical Human Resource Manager. Please answer the following query based on the resume and job description provided.
|
|
|
|
| 4 |
from PyPDF2 import PdfReader
|
| 5 |
import google.generativeai as genai
|
| 6 |
from dotenv import load_dotenv
|
| 7 |
+
import docx
|
| 8 |
|
| 9 |
# Loading the .env keys
|
| 10 |
load_dotenv()
|
|
|
|
| 23 |
for page in pdf_reader.pages:
|
| 24 |
text += page.extract_text()
|
| 25 |
elif doc.name.endswith(".docx"):
|
| 26 |
+
doc_reader = docx.Document(doc)
|
| 27 |
+
for para in doc_reader.paragraphs:
|
| 28 |
+
text += para.text + "\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
return text
|
| 30 |
|
| 31 |
# Define input prompts
|
| 32 |
input_prompts = {
|
| 33 |
"evaluate_resume": """
|
| 34 |
+
You are an experienced Technical Human Resource Manager. Your task is to review the provided resume against the job description.
|
| 35 |
Please share your professional evaluation on whether the candidate's profile aligns with the role.
|
| 36 |
Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
|
| 37 |
+
|
| 38 |
""",
|
| 39 |
"improve_skills": """
|
| 40 |
+
You are a Technical Human Resource Manager with expertise in all domains.
|
| 41 |
+
Your role is to scrutinize the resume in light of the job description provided.
|
| 42 |
Share your insights on the candidate's suitability for the role from an HR perspective.
|
| 43 |
Additionally, offer advice on enhancing the candidate's skills and identify areas where improvement is needed.
|
| 44 |
+
|
| 45 |
""",
|
| 46 |
"missing_keywords": """
|
| 47 |
+
You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of ATS functionality across various domains.
|
| 48 |
+
Your task is to evaluate the resume against the provided job description. As a Human Resource Manager,
|
| 49 |
+
assess the compatibility of the resume with the role. Identify the keywords that are missing.
|
| 50 |
+
Also, provide recommendations for enhancing the candidate's skills and indicate which areas require further development.
|
| 51 |
+
|
| 52 |
""",
|
| 53 |
"percentage_match": """
|
| 54 |
+
You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of ATS functionality across various domains.
|
| 55 |
+
Your task is to evaluate the resume against the provided job description. Give the percentage of match if the resume matches
|
| 56 |
+
the job description. First, present the percentage match, then list the missing keywords, and finally provide your overall thoughts.
|
| 57 |
+
|
| 58 |
""",
|
| 59 |
"answer_query": """
|
| 60 |
You are an experienced Technical Human Resource Manager. Please answer the following query based on the resume and job description provided.
|