nlpblogs commited on
Commit
0fe0c6d
·
verified ·
1 Parent(s): 641cd92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -104,13 +104,15 @@ for i in range(1, 51): # Looping for 2 applicants
104
 
105
  st.divider()
106
 
107
- st.subheader("Visualise Applicant's Profile", divider="blue")
108
- if 'upload_count' not in st.session_state:
109
- st.session_state['upload_count'] = 0
110
-
111
- max_attempts = 3
112
- if st.session_state['upload_count'] < max_attempts:
113
- uploaded_files = st.file_uploader("Upload Applicant's resume", type="pdf")
 
 
114
  if uploaded_files:
115
  st.session_state['upload_count'] += 1
116
 
@@ -131,23 +133,21 @@ if st.session_state['upload_count'] < max_attempts:
131
  fig = px.treemap(entities, path=[px.Constant("all"), 'text', 'label'],
132
  values='score', color='label')
133
  fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
134
- st.plotly_chart(fig)
135
-
136
- else:
137
- st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
138
- if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
139
- st.info(f"Files uploaded {st.session_state['upload_count']} time(s).")
140
-
141
 
142
 
143
- st.divider()
144
- st.subheader("Visualise Similarity", divider="blue")
145
- if 'upload_count' not in st.session_state:
146
- st.session_state['upload_count'] = 0
147
 
148
- max_attempts = 3
149
- if st.session_state['upload_count'] < max_attempts:
150
- uploaded_files = st.file_uploader("Upload Applicant's resume", type="pdf")
 
 
 
 
151
  if uploaded_files:
152
  st.session_state['upload_count'] += 1
153
 
@@ -171,15 +171,15 @@ if st.session_state['upload_count'] < max_attempts:
171
 
172
  fig = px.imshow(cosine_sim_df, text_auto=True,
173
  labels=dict(x="Keyword similarity", y="Resumes", color="Productivity"),
174
- x=['Resume 1', 'Jon Description'],
175
- y=['Resume 1', 'Job Description'])
176
  st.plotly_chart(fig, key="figure 2")
177
 
178
 
179
- else:
180
- st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
181
- if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
182
- st.info(f"Files uploaded {st.session_state['upload_count']} time(s).")
183
 
184
 
185
 
 
104
 
105
  st.divider()
106
 
107
+ col1, col2 = st.columns(2)
108
+
109
+ with col1:
110
+ st.subheader("Visualise Applicant's Profile", divider="blue")
111
+ if 'upload_count' not in st.session_state:
112
+ st.session_state['upload_count'] = 0
113
+ max_attempts = 3
114
+ if st.session_state['upload_count'] < max_attempts:
115
+ uploaded_files = st.file_uploader("Upload Applicant's resume", type="pdf", key = "applicant 1")
116
  if uploaded_files:
117
  st.session_state['upload_count'] += 1
118
 
 
133
  fig = px.treemap(entities, path=[px.Constant("all"), 'text', 'label'],
134
  values='score', color='label')
135
  fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
136
+ st.plotly_chart(fig, key = "figure 1")
137
+ else:
138
+ st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
139
+ if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
140
+ st.info(f"Files uploaded {st.session_state['upload_count']} time(s).")
 
 
141
 
142
 
 
 
 
 
143
 
144
+ with col2:
145
+ st.subheader("Visualise Similarity", divider="blue")
146
+ if 'upload_count' not in st.session_state:
147
+ st.session_state['upload_count'] = 0
148
+ max_attempts = 3
149
+ if st.session_state['upload_count'] < max_attempts:
150
+ uploaded_files = st.file_uploader("Upload Applicant's resume", type="pdf", key = "applicant 2")
151
  if uploaded_files:
152
  st.session_state['upload_count'] += 1
153
 
 
171
 
172
  fig = px.imshow(cosine_sim_df, text_auto=True,
173
  labels=dict(x="Keyword similarity", y="Resumes", color="Productivity"),
174
+ x=['Resume', 'Jon Description'],
175
+ y=['Resume', 'Job Description'])
176
  st.plotly_chart(fig, key="figure 2")
177
 
178
 
179
+ else:
180
+ st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
181
+ if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
182
+ st.info(f"Files uploaded {st.session_state['upload_count']} time(s).")
183
 
184
 
185