Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,9 +42,12 @@ def match_jd(jd_text):
|
|
42 |
jd_vector = get_embeddings([jd_text])[0]
|
43 |
top_k_indices = search_similar_cvs(jd_vector, faiss_index, k=3)
|
44 |
|
45 |
-
|
46 |
matched_names = [os.path.basename(cv_names[i]) for i in top_k_indices]
|
47 |
-
matched_texts = [
|
|
|
|
|
|
|
48 |
|
49 |
summary = summarize_match(jd_text, matched_names, matched_texts)
|
50 |
return f"✅ Top Matches:\n{matched_names}\n\n📝 Summary:\n{summary}"
|
|
|
42 |
jd_vector = get_embeddings([jd_text])[0]
|
43 |
top_k_indices = search_similar_cvs(jd_vector, faiss_index, k=3)
|
44 |
|
45 |
+
import os
|
46 |
matched_names = [os.path.basename(cv_names[i]) for i in top_k_indices]
|
47 |
+
matched_texts = [
|
48 |
+
cv_texts[i][:500] if cv_texts[i].strip() else "[No CV content]"
|
49 |
+
for i in top_k_indices
|
50 |
+
]
|
51 |
|
52 |
summary = summarize_match(jd_text, matched_names, matched_texts)
|
53 |
return f"✅ Top Matches:\n{matched_names}\n\n📝 Summary:\n{summary}"
|