Lord-Champaklal commited on
Commit
d1b141e
·
verified ·
1 Parent(s): e1cda87

Upload 4 files

Browse files
Files changed (4) hide show
  1. .gitignore +160 -0
  2. README.md +1 -13
  3. app.py +149 -0
  4. requirements.txt +5 -0
.gitignore ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
README.md CHANGED
@@ -1,13 +1 @@
1
- ---
2
- title: HTF2024
3
- emoji: 🐠
4
- colorFrom: gray
5
- colorTo: gray
6
- sdk: streamlit
7
- sdk_version: 1.31.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ # Resume-ATS-Tracking
 
 
 
 
 
 
 
 
 
 
 
 
app.py ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dotenv import load_dotenv
2
+
3
+ load_dotenv()
4
+
5
+ import streamlit as st
6
+ import os
7
+ import io
8
+ import base64
9
+ from PIL import Image
10
+ import pdf2image
11
+
12
+ import google.generativeai as genai
13
+
14
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
15
+ os.environ["PATH"] += os.pathsep + "/usr/bin"
16
+ def get_gemini_response(input, pdf_content, prompt):
17
+ model = genai.GenerativeModel('gemini-pro-vision')
18
+ response = model.generate_content([input, pdf_content[0], prompt])
19
+ return response.text
20
+
21
+ def input_pdf_setup(uploaded_file):
22
+ # Converting the PDF to Image
23
+ if uploaded_file is not None:
24
+ images = pdf2image.convert_from_bytes(uploaded_file.read(), poppler_path="/usr/bin")
25
+
26
+ first_page = images[0]
27
+
28
+ # Convert into Bytes
29
+ img_byte_arr = io.BytesIO()
30
+ first_page.save(img_byte_arr, format='JPEG')
31
+ img_byte_arr = img_byte_arr.getvalue()
32
+
33
+ pdf_parts = [
34
+ {
35
+ "mime_type": "image/jpeg",
36
+ "data": base64.b64encode(img_byte_arr).decode() # encode to base 64
37
+ }
38
+ ]
39
+ return pdf_parts
40
+ else:
41
+ raise FileNotFoundError("No file uploaded")
42
+
43
+ ## StreamLit App
44
+ st.set_page_config(page_title="ATS Resume Expert")
45
+ st.header("ATS Tracking System")
46
+ input_text = st.text_area("Job Description: ", key="input")
47
+ uploaded_file = st.file_uploader("Upload a Resume (PDF)", type="pdf")
48
+
49
+ if uploaded_file is not None:
50
+ st.write("PDF uploaded successfully")
51
+
52
+ ## THE 4 BUTTONS OF THE APPLICATION:
53
+ submit1 = st.button("Review My Resume")
54
+
55
+ submit2 = st.button("How can I improvise my skills")
56
+
57
+ submit3 = st.button("Percentage Match")
58
+
59
+ submit4 = st.button("What are the Keywords that are Missing?")
60
+
61
+ submit5 = st.button("Technical Skills")
62
+
63
+ # for the above buttons, we have an example input prompt:
64
+ input_prompt1 = """
65
+ You are an experienced HR with Tech Experience in the field of Data Science, Full Stack Web Development,
66
+ Devops, Data Analyst, your task is to review the provided resume
67
+ against the job description for these profiles. Please share your professional evaluation on
68
+ whether the candidate's profile aligns with the role.
69
+ Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
70
+ """
71
+
72
+ input_prompt2 = """
73
+ You are an experienced and skilled ATS (Application Tracking System) scanner with a deep understanding of
74
+ data science, full stack web development, devops, data analyst, and deep ATS functionality. Your task is
75
+ to evaluate the resume and then provide the candidate with insights on how they can improvise
76
+ their skills according to the job description provided. Jot down bullet points on how the candidate can
77
+ improvise their skills so that they can align with the job description.
78
+ """
79
+
80
+ input_prompt3 = """
81
+ You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of Data Science,
82
+ Full Stack Web Development, Devops, Data Analyst, and deep ATS functionality, your task is to
83
+ evaluate the resume against the provided job description. Give me the percentage of match if the resume
84
+ matches the job description. First the output should come as percentage and then keywords missing and
85
+ last final thoughts.
86
+ """
87
+
88
+ input_prompt4 = """
89
+ You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of Data Science,
90
+ Full Stack Web Development, DevOps, and Data Analyst roles. The job description has several keywords
91
+ that are important for the role. Your task is to evaluate the resume against the provided job description
92
+ and then provide the candidate with insights on the keywords that are missing in the resume.
93
+ Provide the candidate with the missing keywords and how they can improvise their resume to
94
+ align with the job description.
95
+ Jot down the missing keywords along with reasons why they are important for the role in a list manner."""
96
+
97
+ input_prompt5 = """
98
+ You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of Data Science and
99
+ Full Stack Web Development roles. Your task is to filter out the technical skills from the resume and
100
+ then mention them in bullet points in the output. There should be no other information in the output.
101
+ """
102
+
103
+ if submit1:
104
+ if uploaded_file is not None:
105
+ pdf_content = input_pdf_setup(uploaded_file)
106
+ response = get_gemini_response(input_prompt1, pdf_content, input_text)
107
+ st.subheader("Recommendation by the A.I.")
108
+ st.write(response)
109
+ else:
110
+ st.write("Please upload the Resume PDF")
111
+
112
+ elif submit2:
113
+ if uploaded_file is not None:
114
+ pdf_content = input_pdf_setup(uploaded_file)
115
+ response = get_gemini_response(input_prompt2, pdf_content, input_text)
116
+ st.subheader("Recommendation by the A.I.")
117
+ st.write(response)
118
+ else:
119
+ st.write("Please upload the Resume PDF")
120
+
121
+ elif submit3:
122
+ if uploaded_file is not None:
123
+ pdf_content = input_pdf_setup(uploaded_file)
124
+ response = get_gemini_response(input_prompt3, pdf_content, input_text)
125
+ st.subheader("Recommendation by the A.I.")
126
+ st.write(response)
127
+ else:
128
+ st.write("Please upload the Resume PDF")
129
+
130
+ elif submit4:
131
+ if uploaded_file is not None:
132
+ pdf_content = input_pdf_setup(uploaded_file)
133
+ response = get_gemini_response(input_prompt4, pdf_content, input_text)
134
+ st.subheader("Recommendation by the A.I.")
135
+ st.write(response)
136
+ else:
137
+ st.write("Please upload the Resume PDF")
138
+
139
+ elif submit5:
140
+ if uploaded_file is not None:
141
+ pdf_content = input_pdf_setup(uploaded_file)
142
+ response = get_gemini_response(input_prompt5, pdf_content, input_text)
143
+ st.subheader("Here is a list of your Technical Skills")
144
+ st.write(response)
145
+ else:
146
+ st.write("Please upload the Resume PDF")
147
+
148
+
149
+
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ streamlit
2
+ google-generativeai
3
+ python-dotenv
4
+ pdf2image
5
+ PyPDF2