TalentLensAI / README.md
Johnny
fixed readme configuration
cb366d6

A newer version of the Streamlit SDK is available: 1.45.1

Upgrade
metadata
title: TalentLensAI
emoji: πŸƒ
colorFrom: red
colorTo: green
sdk: streamlit
sdk_version: 1.43.1
app_file: app.py
pinned: false
license: apache-2.0
short_description: 'AI - Powered Resume Screening Bot Application '

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

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.

Features

Resume Summarization: Uses Facebook's BART model (facebook/bart-large-cnn) to generate a concise summary of the resume.

Candidate Scoring: Evaluates resumes using Google's Gemma model (google/gemma-7b) to determine their relevance to the job description.

Database Integration: Stores candidate information, resume summary, and scores in Supabase.

PDF Report Generation: Generates a PDF report summarizing the evaluation results.

Streamlit UI: Provides a user-friendly interface for uploading resumes and reviewing results.

Setup Instructions

  1. Clone the Repository
git clone https://github.com/yourusername/TalentLensAI.git
cd TalentLensAI
  1. Create a Virtual Environment and Install Dependencies
python -m venv myenv
source myenv/bin/activate  # On Windows use `myenv\Scripts\activate`
pip install -r requirements.txt
  1. Configure Environment Variables

Create a .env file in the root directory and add the following:

HUGGINGFACE_API_KEY=your_huggingface_api_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
  1. Run the Application
streamlit run main.py

Updated Functionality

Querying Hugging Face Models

The application now supports querying both gemma-7b and bart-large-cnn models:

def query(payload, model="gemma"): if model not in HF_MODELS: raise ValueError("Invalid model name. Choose 'gemma' or 'bart'.")

api_url = f"https://api-inference.huggingface.co/models/{HF_MODELS[model]}"
try:
    response = requests.post(api_url, headers=HF_HEADERS, json=payload)
    if response.status_code == 401:
        print(f"❌ Unauthorized: Check your Hugging Face API key for model '{model}'.")
        return None
    response.raise_for_status()
    return response.json()
except requests.exceptions.RequestException as e:
    print(f"❌ Error querying Hugging Face model '{model}': {e}")
    return None

Fixed Issues & Improvements

Fixed UnboundLocalError by ensuring response is always initialized before use.

Handled 401 Unauthorized errors by validating the Hugging Face API key at startup.

Enhanced Supabase Integration to prevent null values from violating constraints.

Modularized st.markdown styling for a better Streamlit UI experience.

Database Schema

The candidates table in Supabase is structured as follows:

CREATE TABLE candidates ( id SERIAL PRIMARY KEY, resume_filename TEXT NOT NULL, email TEXT NOT NULL, name TEXT NOT NULL, resume_text TEXT NOT NULL, score FLOAT NOT NULL, created_at TIMESTAMP DEFAULT NOW(), summary TEXT NOT NULL );

Testing

Unit tests are implemented using pytest. Run tests with:

pytest tests/

Roadmap

βœ… Multi-model support for Hugging Face APIs

βœ… Improved error handling for API failures

πŸ”œ Enhance the resume parsing for better job-specific keyword extraction

πŸ”œ Implement email notifications for shortlisted candidates

Contributors

Gaurav Sharma Jonathan Nguyen

License

This project is licensed under the MIT License - see the LICENSE file for details.