File size: 3,121 Bytes
840f8bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# 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 <repository-url>
   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.