Johnny commited on
Commit
815bee6
Β·
1 Parent(s): edfcf73

updated readme, renamed to app.py

Browse files
Files changed (2) hide show
  1. README.md +115 -21
  2. main.py β†’ app.py +0 -0
README.md CHANGED
@@ -1,21 +1,115 @@
1
- ---
2
- title: TalentLensAI
3
- emoji: πŸƒ
4
- colorFrom: red
5
- colorTo: green
6
- sdk: streamlit
7
- sdk_version: 1.43.1
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- short_description: 'AI - Powered Resume Screening Bot Application '
12
- ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
15
-
16
- # project summary
17
- # table of contents
18
- # file directory
19
- # backend and frontend tech stack
20
- # model evaluation
21
- # research paper (nice to have)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ TalentLensAI
2
+
3
+ TalentLensAI is an AI-powered resume screening and evaluation tool that leverages Hugging Face models for summarization and scoring. It integrates with Supabase for candidate data storage and utilizes Streamlit for an interactive user interface.
4
+
5
+ Features
6
+
7
+ Resume Summarization: Uses Facebook's BART model (facebook/bart-large-cnn) to generate a concise summary of the resume.
8
+
9
+ Candidate Scoring: Evaluates resumes using Google's Gemma model (google/gemma-7b) to determine their relevance to the job description.
10
+
11
+ Database Integration: Stores candidate information, resume summary, and scores in Supabase.
12
+
13
+ PDF Report Generation: Generates a PDF report summarizing the evaluation results.
14
+
15
+ Streamlit UI: Provides a user-friendly interface for uploading resumes and reviewing results.
16
+
17
+ Setup Instructions
18
+
19
+ 1. Clone the Repository
20
+ ```
21
+ git clone https://github.com/yourusername/TalentLensAI.git
22
+ cd TalentLensAI
23
+ ```
24
+
25
+ 2. Create a Virtual Environment and Install Dependencies
26
+ ```
27
+ python -m venv myenv
28
+ source myenv/bin/activate # On Windows use `myenv\Scripts\activate`
29
+ pip install -r requirements.txt
30
+ ```
31
+
32
+ 3. Configure Environment Variables
33
+
34
+ Create a .env file in the root directory and add the following:
35
+ ```
36
+ HUGGINGFACE_API_KEY=your_huggingface_api_key
37
+ SUPABASE_URL=your_supabase_url
38
+ SUPABASE_KEY=your_supabase_anon_key
39
+ ```
40
+
41
+ 4. Run the Application
42
+ ```
43
+ streamlit run main.py
44
+ ```
45
+ Updated Functionality
46
+
47
+ Querying Hugging Face Models
48
+
49
+ The application now supports querying both gemma-7b and bart-large-cnn models:
50
+
51
+ def query(payload, model="gemma"):
52
+ if model not in HF_MODELS:
53
+ raise ValueError("Invalid model name. Choose 'gemma' or 'bart'.")
54
+
55
+ api_url = f"https://api-inference.huggingface.co/models/{HF_MODELS[model]}"
56
+ try:
57
+ response = requests.post(api_url, headers=HF_HEADERS, json=payload)
58
+ if response.status_code == 401:
59
+ print(f"❌ Unauthorized: Check your Hugging Face API key for model '{model}'.")
60
+ return None
61
+ response.raise_for_status()
62
+ return response.json()
63
+ except requests.exceptions.RequestException as e:
64
+ print(f"❌ Error querying Hugging Face model '{model}': {e}")
65
+ return None
66
+
67
+ Fixed Issues & Improvements
68
+
69
+ Fixed UnboundLocalError by ensuring response is always initialized before use.
70
+
71
+ Handled 401 Unauthorized errors by validating the Hugging Face API key at startup.
72
+
73
+ Enhanced Supabase Integration to prevent null values from violating constraints.
74
+
75
+ Modularized st.markdown styling for a better Streamlit UI experience.
76
+
77
+ Database Schema
78
+
79
+ The candidates table in Supabase is structured as follows:
80
+
81
+ CREATE TABLE candidates (
82
+ id SERIAL PRIMARY KEY,
83
+ resume_filename TEXT NOT NULL,
84
+ email TEXT NOT NULL,
85
+ name TEXT NOT NULL,
86
+ resume_text TEXT NOT NULL,
87
+ score FLOAT NOT NULL,
88
+ created_at TIMESTAMP DEFAULT NOW(),
89
+ summary TEXT NOT NULL
90
+ );
91
+
92
+ Testing
93
+
94
+ Unit tests are implemented using pytest. Run tests with:
95
+
96
+ pytest tests/
97
+
98
+ Roadmap
99
+
100
+ βœ… Multi-model support for Hugging Face APIs
101
+
102
+ βœ… Improved error handling for API failures
103
+
104
+ πŸ”œ Enhance the resume parsing for better job-specific keyword extraction
105
+
106
+ πŸ”œ Implement email notifications for shortlisted candidates
107
+
108
+ Contributors
109
+
110
+ Gaurav Sharma
111
+ Jonathan Nguyen
112
+
113
+ License
114
+
115
+ This project is licensed under the MIT License - see the LICENSE file for details.
main.py β†’ app.py RENAMED
File without changes