Spaces:
Sleeping
Sleeping
Sudhir878786
commited on
Commit
•
667c2bf
1
Parent(s):
bc726ca
Add application file
Browse files- README.md +11 -7
- app.py +263 -0
- requirements.txt +5 -0
README.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: indigo
|
6 |
sdk: streamlit
|
7 |
-
sdk_version: 1.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
license: mit
|
11 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
1 |
---
|
2 |
+
title: IntervuPro.ai
|
3 |
+
|
|
|
|
|
4 |
sdk: streamlit
|
5 |
+
sdk_version: 1.19.0
|
6 |
app_file: app.py
|
7 |
pinned: false
|
|
|
8 |
---
|
9 |
+
IntervuPro.Ai is an innovative tool designed to assist individuals in preparing for job interviews using the power of GPT-3.5. With its intuitive interface, users can choose from three different modes to cater to their specific needs.
|
10 |
+
|
11 |
+
Prepare for a Specific Interview: Users can simulate a job interviewer for a particular company, position, and round. IntervuPro.Ai provides detailed characteristics for both the job interview and the specific company's interview. It offers valuable insights into what to expect and how to approach the interview process.
|
12 |
+
|
13 |
+
Understand the Requirements of a Specific Position: For those seeking to understand the job requirements better, IntervuPro.Ai acts as a talent recruiter. Users can input the position they are interested in, and the tool provides comprehensive behavior and technical requirements for the position.
|
14 |
+
|
15 |
+
Analyze Resume: To gain a competitive edge, users can submit their resume, and IntervuPro.Ai serves as a talent recruiter again. It assesses the resume for a given position and suggests advantages and disadvantages. The tool offers improvement advice to enhance the resume's relevance and potential to match the position's requirements.
|
16 |
|
17 |
+
Powered by OpenAI's GPT-3.5 model, IntervuPro.Ai leverages natural language processing to generate prompt-based responses tailored to the users' specific inquiries. It provides valuable and personalized feedback, ensuring individuals are better prepared and confident for their upcoming interviews.
|
app.py
ADDED
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
1 |
+
|
2 |
+
import openai
|
3 |
+
import streamlit as st
|
4 |
+
import fitz
|
5 |
+
|
6 |
+
import streamlit as st
|
7 |
+
|
8 |
+
def developer_details():
|
9 |
+
st.sidebar.markdown("# Developer Details")
|
10 |
+
|
11 |
+
developers = [
|
12 |
+
{
|
13 |
+
"name": "Sudhir Sharma",
|
14 |
+
"role": "B.Tech CSE - IIT Bhilai 2024",
|
15 |
+
"email": "[email protected]",
|
16 |
+
"github": "https://github.com/Sudhir878786",
|
17 |
+
"linkedin": "https://www.linkedin.com/in/sudhirsharma87/",
|
18 |
+
"avatar": "https://avatars.githubusercontent.com/u/92601949?v=4", # Replace with actual image URL
|
19 |
+
},
|
20 |
+
# Add more developers if needed
|
21 |
+
]
|
22 |
+
|
23 |
+
for developer in developers:
|
24 |
+
st.sidebar.markdown(f"## {developer['name']}")
|
25 |
+
st.sidebar.image(developer['avatar'], width=150)
|
26 |
+
st.sidebar.write(f"**Role:** {developer['role']}")
|
27 |
+
st.sidebar.write(f"**Email:** {developer['email']}")
|
28 |
+
st.sidebar.write(f"**GitHub:** {developer['github']}")
|
29 |
+
st.sidebar.write(f"**LinkedIn:** {developer['linkedin']}")
|
30 |
+
st.sidebar.markdown("---")
|
31 |
+
|
32 |
+
# Call the function to display the container in the sidebar
|
33 |
+
developer_details()
|
34 |
+
|
35 |
+
|
36 |
+
def prompt1(company,position,round,intervier_level):
|
37 |
+
prompt=f"""
|
38 |
+
I want you to act as a {intervier_level} for {round} interviews on {company} company for the position of {position}. You'll suggest the characteristics of this job interview and the characteristics of the {company}'s interview.
|
39 |
+
The return format should bullet point be like this:
|
40 |
+
Characteristics of this job interview:
|
41 |
+
- name: detail explanation
|
42 |
+
Characteristics of {company}:
|
43 |
+
- name: detail explanation
|
44 |
+
"""
|
45 |
+
return prompt
|
46 |
+
|
47 |
+
def followup1(company,position,round,bullet_point):
|
48 |
+
prompt=f"""
|
49 |
+
Can you talk the detail about {bullet_point} for {round} interviews on {company} company for the position of {position}?
|
50 |
+
The return format should bullet point be like this:
|
51 |
+
- name: detail explanation
|
52 |
+
"""
|
53 |
+
return prompt
|
54 |
+
|
55 |
+
def prompt2(position):
|
56 |
+
prompt=f"""
|
57 |
+
I want you to act as a talent recruiter for the position of {position}'s interviews. You'll suggest the characteristics of this job interview for both behavior requirement and technical requirement.
|
58 |
+
The return format should bullet point be like this:
|
59 |
+
Characteristics of this behavior requirement:
|
60 |
+
- name: detail explanation
|
61 |
+
Characteristics of technical requirement:
|
62 |
+
- name: detail explanation
|
63 |
+
"""
|
64 |
+
return prompt
|
65 |
+
|
66 |
+
def followup2(position,bullet_point):
|
67 |
+
prompt=f"""
|
68 |
+
Can you talk the detail about {bullet_point} for the interview of {position}?
|
69 |
+
The return format should bullet point be like this:
|
70 |
+
- name: detail impovement advice
|
71 |
+
"""
|
72 |
+
return prompt
|
73 |
+
|
74 |
+
def prompt3(position,resume,dis_num,ad_num):
|
75 |
+
prompt=f"""
|
76 |
+
I want you to act as a talent recruiter for hiring {position}. I will give you a resume and you'll suggest what are {dis_num}+ disadvantages and {ad_num}+ advantages of the {position} position. Please remember, the return should be highly related to the {position} position.
|
77 |
+
The return format should bullet point be like this:
|
78 |
+
Disadvatage:
|
79 |
+
- name: Suggestions for improvements to make the resume more appropriate for the {position} position and link to specific sentences on the resume.
|
80 |
+
Advantage:
|
81 |
+
- name: use one sentence to explain why it is advantageous for the {position} position.
|
82 |
+
|
83 |
+
Here is the resume:
|
84 |
+
{resume}.
|
85 |
+
"""
|
86 |
+
return prompt
|
87 |
+
|
88 |
+
def followup3(position,resume,bullet_point):
|
89 |
+
prompt=f"""
|
90 |
+
Can you talk the detail about {bullet_point} for the position of {position} based on {resume}?
|
91 |
+
The return format should bullet point be like this:
|
92 |
+
- name: detail impovement advice
|
93 |
+
"""
|
94 |
+
return prompt
|
95 |
+
|
96 |
+
|
97 |
+
def ask(prompt):
|
98 |
+
rsp = openai.ChatCompletion.create(
|
99 |
+
model="gpt-3.5-turbo",
|
100 |
+
messages=[
|
101 |
+
{"role": "system", "content": prompt},
|
102 |
+
]
|
103 |
+
)
|
104 |
+
|
105 |
+
output=rsp.choices[0].message.content
|
106 |
+
return output
|
107 |
+
|
108 |
+
####################
|
109 |
+
|
110 |
+
st.title('IntervuPro.Ai')
|
111 |
+
st.subheader('A tool using to help people prepare their interview by using gpt3.5')
|
112 |
+
|
113 |
+
# environment setup
|
114 |
+
key=st.text_input('Please input your OpenAI key')
|
115 |
+
openai.api_key=key
|
116 |
+
|
117 |
+
option = st.selectbox(
|
118 |
+
'How would you like to prepare for the interview?',
|
119 |
+
('Prepare for a specific interview',
|
120 |
+
'Understand the requirement of a specific position',
|
121 |
+
'Analyze resume',
|
122 |
+
))
|
123 |
+
|
124 |
+
if "submit" not in st.session_state:
|
125 |
+
st.session_state["submit"] = False
|
126 |
+
|
127 |
+
st.write('')
|
128 |
+
###### option 1
|
129 |
+
if option=='Prepare for a specific interview':
|
130 |
+
col1, col2= st.columns(2)
|
131 |
+
with col1:
|
132 |
+
company=st.text_input('Input your company','Amazon')
|
133 |
+
with col2:
|
134 |
+
position=st.text_input('Input your position','Data engineer')
|
135 |
+
|
136 |
+
col3, col4 = st.columns(2)
|
137 |
+
with col3:
|
138 |
+
intervier_level=st.text_input('Input your interviewer level: ','Talent Recuriter')
|
139 |
+
with col4:
|
140 |
+
round=st.radio('Select your round: ',('Phone Screen','Behavior Interview','Technical Interview', 'General'))
|
141 |
+
if round=='General':
|
142 |
+
round=''
|
143 |
+
|
144 |
+
st.write('Click button again if you want to regenerate a new ansewer.')
|
145 |
+
submit_button=st.button('Submit')
|
146 |
+
|
147 |
+
if st.session_state.get('button') != True:
|
148 |
+
st.session_state['button'] = submit_button
|
149 |
+
if st.session_state['button'] == True:
|
150 |
+
prompt=prompt1(company,position,round,intervier_level)
|
151 |
+
output=ask(prompt)
|
152 |
+
st.write(output)
|
153 |
+
|
154 |
+
followup_time=0
|
155 |
+
followup=''
|
156 |
+
while True:
|
157 |
+
output_list=output.split('\n')
|
158 |
+
indexes = [i for i, word in enumerate(output_list) if '- ' in word]
|
159 |
+
new_list = [output_list[i] for i in indexes]
|
160 |
+
Cq=[i.split(':')[0].strip('- ') for i in new_list]
|
161 |
+
Cq = ['None']+ Cq
|
162 |
+
|
163 |
+
followup_radio = st.radio('I want to follow up:', tuple(Cq),key='0')
|
164 |
+
if followup_radio:
|
165 |
+
followup_time +=1
|
166 |
+
if followup_radio == 'None':
|
167 |
+
break
|
168 |
+
else:
|
169 |
+
if followup_radio != 'None':
|
170 |
+
followup = followup1(company, position, round, followup_radio)
|
171 |
+
output = ask(followup)
|
172 |
+
st.write(output)
|
173 |
+
if followup_time>5:
|
174 |
+
break
|
175 |
+
|
176 |
+
|
177 |
+
###### option 2
|
178 |
+
if option =='Understand the requirement of a specific position':
|
179 |
+
position=st.text_input('Input your position','Data engineer')
|
180 |
+
|
181 |
+
st.write('Click button again if you want to regenerate a new ansewer.')
|
182 |
+
|
183 |
+
#submit=st.checkbox('submit')
|
184 |
+
submit=st.button('submit')
|
185 |
+
|
186 |
+
if submit:
|
187 |
+
prompt=prompt2(position)
|
188 |
+
output=ask(prompt)
|
189 |
+
st.write(output)
|
190 |
+
|
191 |
+
followup=''
|
192 |
+
output_list=output.split('\n')
|
193 |
+
indexes = [i for i, word in enumerate(output_list) if '- ' in word]
|
194 |
+
new_list = [output_list[i] for i in indexes]
|
195 |
+
Cq=[i.split(':')[0].strip('- ') for i in new_list]
|
196 |
+
Cq = ['None']+ Cq
|
197 |
+
|
198 |
+
|
199 |
+
followup_radio = st.radio('I want to follow up:', tuple(Cq))
|
200 |
+
if followup_radio!='None':
|
201 |
+
followup = followup2(position,followup_radio)
|
202 |
+
op = ask(followup)
|
203 |
+
st.write(op)
|
204 |
+
|
205 |
+
|
206 |
+
###### option 3
|
207 |
+
|
208 |
+
if option =='Analyze resume':
|
209 |
+
|
210 |
+
# col31, col32,col33= st.columns(3)
|
211 |
+
# with col31:
|
212 |
+
# position=st.text_input('Input your position','data engineer')
|
213 |
+
# with col32:
|
214 |
+
# dis_num=st.text_input('Input your dis_num','6')
|
215 |
+
# with col33:
|
216 |
+
# ad_num=st.text_input('Input your ad_num','4')
|
217 |
+
|
218 |
+
position=st.text_input('Input your position','data engineer')
|
219 |
+
dis_num=6
|
220 |
+
ad_num=4
|
221 |
+
|
222 |
+
uploaded_file = st.file_uploader("Upload your resume", type=["pdf"])
|
223 |
+
if uploaded_file:
|
224 |
+
|
225 |
+
if "submit" not in st.session_state:
|
226 |
+
st.session_state["submit"] = False
|
227 |
+
|
228 |
+
doc = fitz.open(stream=uploaded_file.read(), filetype="pdf")
|
229 |
+
resume = ""
|
230 |
+
for page in doc:
|
231 |
+
resume += page.get_text()
|
232 |
+
|
233 |
+
st.write('Click button again if you want to regenerate a new ansewer.')
|
234 |
+
submit_button=st.button('Submit')
|
235 |
+
|
236 |
+
if st.session_state.get('button') != True:
|
237 |
+
st.session_state['button'] = submit_button
|
238 |
+
if st.session_state['button'] == True:
|
239 |
+
prompt=prompt3(position,resume,dis_num,ad_num)
|
240 |
+
output=ask(prompt)
|
241 |
+
st.write(output)
|
242 |
+
|
243 |
+
followup_time=0
|
244 |
+
while True:
|
245 |
+
output_list=output.split('\n')
|
246 |
+
output_list= [element for element in output_list if element != '']
|
247 |
+
|
248 |
+
ind = [i for i, word in enumerate(output_list) if 'Advantage:' in word]
|
249 |
+
Cdis_list=output_list[1:int(dis_num)+1]
|
250 |
+
Cdis=[i.split(':')[0].strip('- ') for i in Cdis_list]
|
251 |
+
Cdis = ['None']+ Cdis
|
252 |
+
|
253 |
+
followup_radio = st.radio('I want to follow up:', tuple(Cdis),key=followup_time)
|
254 |
+
followup_time +=1
|
255 |
+
if followup_radio == 'None':
|
256 |
+
break
|
257 |
+
else:
|
258 |
+
followup = followup3(position,resume,followup_radio)
|
259 |
+
output = ask(followup)
|
260 |
+
st.write(output)
|
261 |
+
if followup_time>4:
|
262 |
+
break
|
263 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
langchain
|
2 |
+
openai
|
3 |
+
streamlit
|
4 |
+
PyMuPDF
|
5 |
+
scikit-learn
|