Update app.py
Browse files
app.py
CHANGED
@@ -133,24 +133,19 @@ if st.session_state['upload_count'] < max_attempts:
|
|
133 |
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
|
134 |
st.plotly_chart(fig, key="figure 1")
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
fig = px.imshow(cosine_sim_df, text_auto=True,
|
144 |
labels=dict(x="Keyword similarity", y="Resumes", color="Productivity"),
|
145 |
x=['Resume', 'Jon Description'],
|
146 |
y=['Resume', 'Job Description'])
|
147 |
-
|
148 |
|
149 |
-
|
150 |
-
with st.popover("See result"):
|
151 |
-
st.write(f"Similarity of job description with Applicant's 1 resume based on keywords: {similarity_score:.2f}")
|
152 |
-
st.info(
|
153 |
-
"A score closer to 1 (0.80, 0.90) means higher similarity between Applicant's 1 resume and job description. A score closer to 0 (0.20, 0.30) means lower similarity between Applicant's 1 resume and job description.")
|
154 |
else:
|
155 |
st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
|
156 |
if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
|
|
|
133 |
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
|
134 |
st.plotly_chart(fig, key="figure 1")
|
135 |
|
136 |
+
with tab2:
|
137 |
+
vectorizer = TfidfVectorizer()
|
138 |
+
tfidf_matrix = vectorizer.fit_transform(result)
|
139 |
+
tfidf_df = pd.DataFrame(tfidf_matrix.toarray(), columns=vectorizer.get_feature_names_out())
|
140 |
+
cosine_sim_matrix = cosine_similarity(tfidf_matrix)
|
141 |
+
cosine_sim_df = pd.DataFrame(cosine_sim_matrix)
|
142 |
+
fig = px.imshow(cosine_sim_df, text_auto=True,
|
|
|
143 |
labels=dict(x="Keyword similarity", y="Resumes", color="Productivity"),
|
144 |
x=['Resume', 'Jon Description'],
|
145 |
y=['Resume', 'Job Description'])
|
146 |
+
st.plotly_chart(fig, key="figure 2")
|
147 |
|
148 |
+
|
|
|
|
|
|
|
|
|
149 |
else:
|
150 |
st.warning(f"You have reached the maximum upload attempts ({max_attempts}).")
|
151 |
if 'upload_count' in st.session_state and st.session_state['upload_count'] > 0:
|