Spaces:
Sleeping
Sleeping
Commit
Β·
c94e23a
1
Parent(s):
9971fc6
Create HR Resume Screening Assistance.py
Browse files
pages/HR Resume Screening Assistance.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from utils import *
|
| 3 |
+
import uuid
|
| 4 |
+
#https://streamlit-emoji-shortcodes-streamlit-app-gwckff.streamlit.app/
|
| 5 |
+
#Creating session variables
|
| 6 |
+
if 'unique_id' not in st.session_state:
|
| 7 |
+
st.session_state['unique_id'] =''
|
| 8 |
+
|
| 9 |
+
def main():
|
| 10 |
+
|
| 11 |
+
#st.set_page_config(page_title="Resume Screening BOT")
|
| 12 |
+
|
| 13 |
+
st.set_page_config(
|
| 14 |
+
page_title="Resume Screening Assistance",
|
| 15 |
+
page_icon="π",
|
| 16 |
+
layout="wide",
|
| 17 |
+
initial_sidebar_state="expanded",
|
| 18 |
+
menu_items={
|
| 19 |
+
'Get Help': 'https://www.extremelycoolapp.com/help',
|
| 20 |
+
'Report a bug': "https://www.extremelycoolapp.com/bug",
|
| 21 |
+
'About': "# This is a header. This is an *extremely* cool app!"
|
| 22 |
+
}
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
st.title("HR - Resume Screening Assistance π ")
|
| 26 |
+
st.subheader("I can help you in resume screening process")
|
| 27 |
+
|
| 28 |
+
#st.sidebar.title("π")
|
| 29 |
+
st.sidebar.image('./resume_screening.jpg',width=300, use_column_width=True)
|
| 30 |
+
|
| 31 |
+
# Applying Styling
|
| 32 |
+
st.markdown("""
|
| 33 |
+
<style>
|
| 34 |
+
div.stButton > button:first-child {
|
| 35 |
+
background-color: #0099ff;
|
| 36 |
+
color:#ffffff;
|
| 37 |
+
}
|
| 38 |
+
div.stButton > button:hover {
|
| 39 |
+
background-color: #00ff00;
|
| 40 |
+
color:#FFFFFF;
|
| 41 |
+
}
|
| 42 |
+
</style>""", unsafe_allow_html=True)
|
| 43 |
+
|
| 44 |
+
job_description = st.text_area("Please paste the 'JOB DESCRIPTION' here...π",key="1")
|
| 45 |
+
document_count = st.text_input("No.of 'RESUMES' to return",key="2")
|
| 46 |
+
# Upload the Resumes (pdf files)
|
| 47 |
+
pdf = st.file_uploader("Upload resumes here, only PDF files allowed", type=["pdf"],accept_multiple_files=True)
|
| 48 |
+
|
| 49 |
+
submit=st.button("Help me with the analysis")
|
| 50 |
+
|
| 51 |
+
if submit:
|
| 52 |
+
with st.spinner('Wait for it...'):
|
| 53 |
+
|
| 54 |
+
#Creating a unique ID, so that we can use to query and get only the user uploaded documents from PINECONE vector store
|
| 55 |
+
st.session_state['unique_id']=uuid.uuid4().hex
|
| 56 |
+
|
| 57 |
+
#Create a documents list out of all the user uploaded pdf files
|
| 58 |
+
final_docs_list=create_docs(pdf,st.session_state['unique_id'])
|
| 59 |
+
#st.write(final_docs_list)
|
| 60 |
+
|
| 61 |
+
#Displaying the count of resumes that have been uploaded
|
| 62 |
+
st.write("*Resumes uploaded* :"+str(len(final_docs_list)))
|
| 63 |
+
|
| 64 |
+
#Create embeddings instance
|
| 65 |
+
embeddings=create_embeddings_load_data()
|
| 66 |
+
|
| 67 |
+
#Fecth relavant documents from Vectorspace
|
| 68 |
+
relavant_docs=close_matches(job_description,document_count,final_docs_list,embeddings)
|
| 69 |
+
|
| 70 |
+
#Introducing a line separator
|
| 71 |
+
st.write(":heavy_minus_sign:" * 30)
|
| 72 |
+
|
| 73 |
+
#For each item in relavant docs - we are displaying some info of it on the UI
|
| 74 |
+
for item in range(len(relavant_docs)):
|
| 75 |
+
|
| 76 |
+
st.subheader("π "+str(item+1))
|
| 77 |
+
|
| 78 |
+
#Displaying Filepath
|
| 79 |
+
st.write("**File** : "+relavant_docs[item][0].metadata['name'])
|
| 80 |
+
|
| 81 |
+
#Introducing Expander feature
|
| 82 |
+
with st.expander('Show me π'):
|
| 83 |
+
st.info("**Match Score** : "+ str(1 - relavant_docs[item][1]))
|
| 84 |
+
#st.write("***"+relavant_docs[item][0].page_content)
|
| 85 |
+
|
| 86 |
+
#Gets the summary of the current item using 'get_summary' function that we have created which uses LLM & Langchain chain
|
| 87 |
+
summary = get_summary(relavant_docs[item][0])
|
| 88 |
+
st.write("**Summary** : "+summary)
|
| 89 |
+
|
| 90 |
+
st.success("Hope I was able to save your timeβ€οΈ")
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
#Invoking main function
|
| 94 |
+
if __name__ == '__main__':
|
| 95 |
+
main()
|