Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 📌
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
@@ -95,4 +95,30 @@ making the ranking of candidates more accurate and relevant.
|
|
95 |
- Cosine similarity does not account for specific skill weights (all terms treated equally).
|
96 |
- Large file uploads may impact performance on free hosting tiers.
|
97 |
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
colorFrom: blue
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: "3.45.0" # (or your Gradio version)
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
95 |
- Cosine similarity does not account for specific skill weights (all terms treated equally).
|
96 |
- Large file uploads may impact performance on free hosting tiers.
|
97 |
|
98 |
+
## Potential Improvements
|
99 |
+
|
100 |
+
Here are some ideas to enhance the engine’s functionality and performance -
|
101 |
+
|
102 |
+
### 1. Model and Embeddings
|
103 |
+
- Experiment with larger or more recent language models for improved summarization quality.
|
104 |
+
- Fine-tune embedding models on domain-specific data for better candidate-job matching.
|
105 |
+
- Cache embeddings to speed up repeated queries.
|
106 |
+
|
107 |
+
### 2. Ranking & Recommendation
|
108 |
+
- Incorporate additional ranking criteria like experience level, skills match weighting, or recency of resume updates.
|
109 |
+
- Use a hybrid approach combining semantic similarity with keyword matching for more accurate recommendations.
|
110 |
+
|
111 |
+
### 3. Scalability and Deployment
|
112 |
+
- Containerize the app using Docker for easier deployment and scalability.
|
113 |
+
- Integrate with cloud storage (e.g., AWS S3) for resume and job description management.
|
114 |
+
- Use asynchronous processing or batch jobs to handle large volumes of resumes efficiently.
|
115 |
+
|
116 |
+
|
117 |
+
## Install dependencies:
|
118 |
+
pip install -r requirements.txt
|
119 |
+
|
120 |
+
## Running the Engine
|
121 |
+
python app.py
|
122 |
+
|
123 |
+
This will launch the engine locally, typically at http://127.0.0.1:5000/
|
124 |
+
---
|
app.py
CHANGED
@@ -16,15 +16,13 @@ def process_resumes(job_description, uploaded_files):
|
|
16 |
resume_texts = []
|
17 |
|
18 |
for uploaded_file in uploaded_files:
|
19 |
-
# uploaded_file is a file path string from gr.Files
|
20 |
filename = os.path.basename(uploaded_file)
|
21 |
ext = filename.lower().split(".")[-1]
|
22 |
|
23 |
-
#
|
24 |
file_path = os.path.join(UPLOAD_FOLDER, filename)
|
25 |
shutil.copy(uploaded_file, file_path)
|
26 |
|
27 |
-
# Read content based on extension
|
28 |
if ext == "txt":
|
29 |
with open(file_path, "r", encoding="utf-8") as f:
|
30 |
text = f.read()
|
@@ -54,13 +52,17 @@ def process_resumes(job_description, uploaded_files):
|
|
54 |
# Rank resumes and generate summaries
|
55 |
results = rank_resumes(job_description, resume_texts)
|
56 |
|
|
|
|
|
|
|
|
|
57 |
for candidate in results:
|
58 |
candidate["summary"] = summarize_resume_flan(candidate["text"], job_description)
|
59 |
|
60 |
table_data = [
|
61 |
[
|
62 |
-
candidate.get("applicant_name", extract_applicant_name(candidate["text"], candidate.get("
|
63 |
-
candidate.get("
|
64 |
f"{candidate['score']:.4f}",
|
65 |
candidate["summary"]
|
66 |
] for candidate in results
|
|
|
16 |
resume_texts = []
|
17 |
|
18 |
for uploaded_file in uploaded_files:
|
|
|
19 |
filename = os.path.basename(uploaded_file)
|
20 |
ext = filename.lower().split(".")[-1]
|
21 |
|
22 |
+
# Copying the file from Gradio temp folder to uploads folder
|
23 |
file_path = os.path.join(UPLOAD_FOLDER, filename)
|
24 |
shutil.copy(uploaded_file, file_path)
|
25 |
|
|
|
26 |
if ext == "txt":
|
27 |
with open(file_path, "r", encoding="utf-8") as f:
|
28 |
text = f.read()
|
|
|
52 |
# Rank resumes and generate summaries
|
53 |
results = rank_resumes(job_description, resume_texts)
|
54 |
|
55 |
+
# Attach filename to each candidate for display
|
56 |
+
for i, candidate in enumerate(results):
|
57 |
+
candidate["filename"] = resume_texts[i][0]
|
58 |
+
|
59 |
for candidate in results:
|
60 |
candidate["summary"] = summarize_resume_flan(candidate["text"], job_description)
|
61 |
|
62 |
table_data = [
|
63 |
[
|
64 |
+
candidate.get("applicant_name", extract_applicant_name(candidate["text"], candidate.get("filename", "Unknown"))),
|
65 |
+
candidate.get("filename", "Unknown"),
|
66 |
f"{candidate['score']:.4f}",
|
67 |
candidate["summary"]
|
68 |
] for candidate in results
|