This project now includes a standalone app that ranks resumes from a local folder or uploaded files using sentence-transformers embeddings. Optional features include reranking with a free Hugging Face cross-encoder and prompt refinement via local Ollama (Llama3).
pip install -r requirements.txt
# Optional for reranking (uncomment in requirements.txt or install directly):
# pip install transformers torch
python gradio_app.py
Open the URL shown in the terminal (typically http://127.0.0.1:7860).
- Modes:
- Folder Mode: provide path to a directory containing PDF/DOCX resumes.
- Upload Mode: upload one or more PDF/DOCX resumes directly.
- Job Description / Query: text describing the role or requirements.
- Top K: number of top matches to display.
- Min Score: filter out low-relevance results.
- Keywords: comma-separated terms to boost (each unique hit adds to score).
- Keyword Boost: weight per unique keyword found in a resume.
- Use HF Reranker: enable cross-encoder reranking (BAAI/bge-reranker-base).
- Refine via Ollama: if
ollama serveis running withllama3.2pulled, query refinement runs locally. - Export CSV: download current ranking as CSV.
- Preview: view metadata and excerpt for a specific rank.
Notes:
- The embedding model is
all-MiniLM-L6-v2(free on Hugging Face), fast and CPU-friendly. - Reranking uses
BAAI/bge-reranker-baseif installed; otherwise the app still works with embeddings only. - PDF parsing uses PyMuPDF; DOCX parsing uses
docx2txt.
Endpoint: POST /rank-folder/
Body (JSON):
{
"folder_path": "/absolute/path/to/resumes",
"query": "Senior Python developer with Django",
"top_k": 10,
"keywords": "python,django,rest,aws",
"min_score": 0.2,
"keyword_boost": 0.05,
"use_ollama": false,
"use_reranker": false
}
Response:
{
"indexed": 12,
"results": [
{"rank": 1, "name": "...", "path": "...", "score": 0.87, "base_score": 0.82, "keyword_hits": 3, "excerpt": "..."},
...
]
}
If you already have a Conda environment, activate it:
conda activate shadril238 # Replace with your actual environment nameIf you haven’t created one, do:
conda create --name shadril238 python=3.10 -y
conda activate shadril238If your project has a requirements.txt file, install dependencies:
pip install -r requirements.txtOtherwise, manually install Django and DRF:
pip install django djangorestframeworkIf your project uses .env files, install python-dotenv:
pip install python-dotenvThen create a .env file if it doesn’t exist:
touch .envAdd necessary environment variables inside .env:
DJANGO_SECRET_KEY=your_secret_key
DEBUG=True
DATABASE_URL=your_database_url
Run the following command to apply database migrations:
python manage.py migrateIf your project has Django Admin, create an admin user:
python manage.py createsuperuserFollow the prompts to set up a username and password.
Start the development server:
python manage.py runserverBy default, it runs at http://127.0.0.1:8000/.
- API endpoints (if using DRF):
http://127.0.0.1:8000/api/ - Django Admin:
http://127.0.0.1:8000/admin/
- Check if the correct Conda environment is activated:
conda info --envs
- If
manage.pydoesn’t run, check installed packages:pip list
Now your Django Conda project is running successfully! 🚀