# Resume Parser & Summarizer (Streamlit + Hugging Face) A Streamlit web app that parses resumes (PDF/DOCX) and generates an AI summary using the Hugging Face Inference API. It extracts contact details and detected skills and produces a concise summary. ## Features - Upload resumes in PDF or DOCX - Extract contact information (email, phone) - Detect common technical skills via keyword scan - Summarize resume content using a Hugging Face summarization model - Streamlit UI with sidebar for HF model and API token ## Local Installation 1. Clone the repository: ```bash git clone cd windsurf-project-2 ``` 2. Create a virtual environment (recommended): ```bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate ``` 3. Install the required packages: ```bash pip install -r requirements.txt ``` 4. (Optional) Set your Hugging Face token for higher rate limits: ```bash # Windows (PowerShell) setx HF_TOKEN "hf_XXXXXXXXXXXXXXXXXXXXXXXXXXXX" # macOS/Linux export HF_TOKEN="hf_XXXXXXXXXXXXXXXXXXXXXXXXXXXX" ``` ## Usage 1. Run the Streamlit application: ```bash streamlit run app.py ``` 2. Open your web browser and navigate to `http://localhost:8501` 3. Upload a resume file (PDF or DOCX) using the file uploader 4. In the sidebar, set the summarization model (default: `facebook/bart-large-cnn`) and provide your HF API token if not set as a secret or environment variable. 5. View extracted info and the AI-generated summary. ## Hugging Face Inference API This app uses the Hugging Face Inference API via `huggingface-hub` to run text summarization. You can choose a model such as: - `facebook/bart-large-cnn` (default) - `sshleifer/distilbart-cnn-12-6` (faster, smaller) You may supply an API token via any of the following (priority order): 1. `st.secrets["HF_TOKEN"]` 2. Environment variable `HF_TOKEN` 3. Sidebar password input Create a token at: https://huggingface.co/settings/tokens ## Deploy to Hugging Face Spaces 1. Create a new Space at https://huggingface.co/spaces and choose "Streamlit" as the SDK. 2. Push your repository files (ensure `app.py` and `requirements.txt` are present). 3. In the Space, go to Settings → Secrets and add: - Key: `HF_TOKEN` - Value: your Hugging Face token 4. The app will build automatically. Once running, you can change models from the sidebar. Notes: - Keep dependencies minimal for faster builds (see `requirements.txt`). - Uploaded files are kept in the Space runtime; do not rely on persistence across restarts. ## Dependencies - Python 3.9+ - Streamlit - PyPDF2 - python-docx - huggingface-hub ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## Notes & Next Steps This is a lightweight implementation designed to run well on Hugging Face Spaces. Ideas to extend: - Use a custom summarization prompt or instruction-tuned models. - Add job description matching and scoring. - Export parsed data to CSV/JSON. - Improve skill/entity extraction with advanced NLP if needed.