File size: 1,695 Bytes
adbfd9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Application that will help the Resume Screener will llms to find the best fits for the job
import streamlit as st
import uuid

from utils import *

# Creating session variables
if "unique_id" not in st.session_state:
    st.session_state["unique_id"] = ''


def main():
    st.set_page_config(page_title="Resume Screening Assistance")
    st.title('HR Resume Screening Assistance')
    st.subheader('I can help you in resume screening process')

    job_description = st.text_area("Enter your job description", key="1")
    document_count = st.text_area("No.of 'Resumes' to return", key="2")

    # Upload the Resumes (pdf files)
    pdf = st.file_uploader("Upload resumes here, only PDF files allowed", type=["pdf"], accept_multiple_files=True)

    submit = st.button("Help me with the analysis")

    if submit:
        with st.spinner('Wait for it...'):
            # Creating a unique id, so that we can use the query
            # and get only the user uploaded documents from PINECONE vector store
            st.session_state["unique_id"] = uuid.uuid4().hex

            # Create a documents list out of all the user uploaded pdf files
            docs = create_docs(pdf, st.session_state["unique_id"])

            # Display the count of the docs that were uploaded
            st.write(len(docs))

            # Create embeddings instance
            embeddings = create_embeddings_load_data()

            # Push data to PINECONE

            st.write(push_to_pinecone(
                '63987f25-a66d-448f-8a91-d64a9dd71d9a',
                "test", embeddings, docs)
            )

        st.success('Hope I was able to save your time <3')


if __name__ == '__main__':
    main()