Update app.py
Browse files
app.py
CHANGED
@@ -65,16 +65,7 @@ if st.session_state['upload_count'] < max_attempts:
|
|
65 |
data = pd.Series(text_data, name='Text')
|
66 |
frames = [job, data]
|
67 |
result = pd.concat(frames)
|
68 |
-
model = GLiNER.from_pretrained("urchade/gliner_base")
|
69 |
-
labels = ["person", "country", "organization", "role", "skills"]
|
70 |
-
entities = model.predict_entities(text_data, labels)
|
71 |
-
df = pd.DataFrame(entities)
|
72 |
-
|
73 |
|
74 |
-
fig = px.treemap(entities, path=[px.Constant("all"), 'text', 'label'],
|
75 |
-
values='score', color='label')
|
76 |
-
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))
|
77 |
-
st.plotly_chart(fig, key="figure 1")
|
78 |
|
79 |
vectorizer = TfidfVectorizer()
|
80 |
tfidf_matrix = vectorizer.fit_transform(result)
|
@@ -82,16 +73,6 @@ if st.session_state['upload_count'] < max_attempts:
|
|
82 |
cosine_sim_matrix = cosine_similarity(tfidf_matrix)
|
83 |
cosine_sim_df = pd.DataFrame(cosine_sim_matrix)
|
84 |
|
85 |
-
|
86 |
-
fig = px.imshow(cosine_sim_df, text_auto=True,
|
87 |
-
labels=dict(x="Keyword similarity", y="Resumes", color="Productivity"),
|
88 |
-
x=['Resume 1', 'Jon Description'],
|
89 |
-
y=['Resume 1', 'Job Description'])
|
90 |
-
st.plotly_chart(fig, key="figure 2")
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
for i, similarity_score in enumerate(cosine_sim_matrix[0][1:]):
|
96 |
with st.popover("See result"):
|
97 |
st.write(f"Similarity of job description with Applicant's 1 resume based on keywords: {similarity_score:.2f}")
|
|
|
65 |
data = pd.Series(text_data, name='Text')
|
66 |
frames = [job, data]
|
67 |
result = pd.concat(frames)
|
|
|
|
|
|
|
|
|
|
|
68 |
|
|
|
|
|
|
|
|
|
69 |
|
70 |
vectorizer = TfidfVectorizer()
|
71 |
tfidf_matrix = vectorizer.fit_transform(result)
|
|
|
73 |
cosine_sim_matrix = cosine_similarity(tfidf_matrix)
|
74 |
cosine_sim_df = pd.DataFrame(cosine_sim_matrix)
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
for i, similarity_score in enumerate(cosine_sim_matrix[0][1:]):
|
77 |
with st.popover("See result"):
|
78 |
st.write(f"Similarity of job description with Applicant's 1 resume based on keywords: {similarity_score:.2f}")
|