Update app.py
Browse files
app.py
CHANGED
@@ -34,36 +34,16 @@ uploaded_files = st.file_uploader(
|
|
34 |
)
|
35 |
|
36 |
|
37 |
-
all_resumes_text = [] # Store the text content of each PDF
|
38 |
for uploaded_file in uploaded_files:
|
39 |
pdf_reader = PdfReader(uploaded_file)
|
40 |
text_data = ""
|
41 |
for page in pdf_reader.pages:
|
42 |
text_data += page.extract_text()
|
43 |
-
|
|
|
44 |
|
45 |
|
46 |
-
|
47 |
-
all_documents = [job_description_series.iloc[0]] + all_resumes_text
|
48 |
-
|
49 |
-
vectorizer = TfidfVectorizer()
|
50 |
-
tfidf_matrix = vectorizer.fit_transform(all_documents)
|
51 |
-
|
52 |
-
tfidf_df = pd.DataFrame(tfidf_matrix.toarray(), columns=vectorizer.get_feature_names_out())
|
53 |
-
st.subheader("TF-IDF Values:")
|
54 |
-
st.dataframe(tfidf_df)
|
55 |
-
|
56 |
-
cosine_sim_matrix = cosine_similarity(tfidf_matrix)
|
57 |
-
cosine_sim_df = pd.DataFrame(cosine_sim_matrix)
|
58 |
-
st.subheader("Cosine Similarity Matrix:")
|
59 |
-
st.dataframe(cosine_sim_df)
|
60 |
-
|
61 |
-
# Display similarity scores between the job description and each resume
|
62 |
-
st.subheader("Cosine Similarity Scores (Job Description vs. Resumes):")
|
63 |
-
for i, similarity_score in enumerate(cosine_sim_matrix[0][1:]):
|
64 |
-
st.write(f"Similarity with Candidate Profile {i + 1}: {similarity_score:.4f}")
|
65 |
-
|
66 |
-
|
67 |
|
68 |
st.divider()
|
69 |
|
@@ -76,7 +56,7 @@ uploaded_files = st.file_uploader(
|
|
76 |
)
|
77 |
|
78 |
|
79 |
-
|
80 |
|
81 |
|
82 |
for uploaded_file in uploaded_files:
|
@@ -84,29 +64,10 @@ for uploaded_file in uploaded_files:
|
|
84 |
text_data = ""
|
85 |
for page in pdf_reader.pages:
|
86 |
text_data += page.extract_text()
|
87 |
-
|
88 |
|
89 |
|
90 |
-
|
91 |
-
all_documents = [job_description_series.iloc[0]] + all_resumes_text
|
92 |
-
|
93 |
-
vectorizer = TfidfVectorizer()
|
94 |
-
tfidf_matrix = vectorizer.fit_transform(all_documents)
|
95 |
-
|
96 |
-
tfidf_df = pd.DataFrame(tfidf_matrix.toarray(), columns=vectorizer.get_feature_names_out())
|
97 |
-
st.subheader("TF-IDF Values:")
|
98 |
-
st.dataframe(tfidf_df)
|
99 |
-
|
100 |
-
cosine_sim_matrix = cosine_similarity(tfidf_matrix)
|
101 |
-
cosine_sim_df = pd.DataFrame(cosine_sim_matrix)
|
102 |
-
st.subheader("Cosine Similarity Matrix:")
|
103 |
-
st.dataframe(cosine_sim_df)
|
104 |
-
|
105 |
-
# Display similarity scores between the job description and each resume
|
106 |
-
st.subheader("Cosine Similarity Scores (Job Description vs. Resumes):")
|
107 |
-
for i, similarity_score in enumerate(cosine_sim_matrix[0][1:]):
|
108 |
-
st.write(f"Similarity with Candidate Profile {i + 1}: {similarity_score:.4f}")
|
109 |
-
|
110 |
|
111 |
|
112 |
|
|
|
34 |
)
|
35 |
|
36 |
|
|
|
37 |
for uploaded_file in uploaded_files:
|
38 |
pdf_reader = PdfReader(uploaded_file)
|
39 |
text_data = ""
|
40 |
for page in pdf_reader.pages:
|
41 |
text_data += page.extract_text()
|
42 |
+
st.write(text_data)
|
43 |
+
|
44 |
|
45 |
|
46 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
st.divider()
|
49 |
|
|
|
56 |
)
|
57 |
|
58 |
|
59 |
+
|
60 |
|
61 |
|
62 |
for uploaded_file in uploaded_files:
|
|
|
64 |
text_data = ""
|
65 |
for page in pdf_reader.pages:
|
66 |
text_data += page.extract_text()
|
67 |
+
st.write(text_data)
|
68 |
|
69 |
|
70 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
|
73 |
|