Skip to content

DiamondRain0/Coherence

Repository files navigation

📊 COHERENCE -Shaolin Kesisleri-

Empowering Talent Acquisition with Automation and Innovation This project supports SDG 8: Decent Work and Economic Growth by providing an automated solution for efficient recruitment, helping companies and HR teams match talent with the right skills, leading to better employment opportunities and economic development.

Automate and streamline LinkedIn profile data fetching, processing, and analysis using FastAPI. This tool helps extract, store, and analyze profiles to assist in talent acquisition, skill assessments, and profile matching.


📑 Table of Contents


📝 Introduction

This project provides an automated approach to handle LinkedIn profile data, ideal for HR teams and recruitment agencies. By leveraging the LinkedIn API and sentence-transformer models, Coherence enhances recruitment by enabling:

  1. Collecting employee profile data for specific companies.
  2. Matching and ranking candidates based on their similarity to company profiles.
  3. Recommending missing skills and certifications to enhance candidate profiles.

Aligned with SDG 8, this tool seeks to foster decent work and economic growth by simplifying the process of identifying the right talent, improving skills matching, and streamlining hiring processes.

🗂 Project Structure

Here’s a breakdown of the main files in the project:

  • prepare_company_data.py: Collects LinkedIn data for a specific company. Searches for employee profiles, fetches URNs, and saves details to CSV.
  • user_backend.py: FastAPI backend that provides an API endpoint to fetch missing skills and certifications for LinkedIn profiles.
  • hr_backend.py: FastAPI backend that processes profile CSV files for employees and contestants, then calculates similarity scores and ranks contestants based on weighted averages.
  • Dockerfile: Defines the Docker image to containerize the application for consistent deployment.
  • requirements.txt: Lists all the required Python packages for the project.

✨ Features

  • LinkedIn Profile Fetching: Retrieve and save profile data, including name, skills, certifications, and experiences, for employees of a specified company.
  • Skill & Certification Recommendations: Analyze profiles to suggest additional skills and certifications a candidate might need.
  • Contestant Ranking: Rank contestants based on their similarity to company profiles using semantic embeddings.
  • CSV Data Export: Export profile data and ranking results to CSV for easy review and reporting.

⚙️ Setup Instructions

Prerequisites

  • Python 3.7+
  • Libraries: FastAPI, dotenv, pandas, sentence-transformers, LinkedIn API library (e.g., linkedin-api)

Installation

Clone the repository and install dependencies:

git clone https://github.com/DiamondRain0/Coherence.git
cd Coherence
pip install -r requirements.txt

🔐 Environment Variables

  1. Create a .env file in the project root to store LinkedIn API credentials.
  2. Set the following variables:
    [email protected]
    LINKEDIN_PASSWORD=your_password
    

🐳 Docker Setup

To make deployment easier, you can containerize the project with Docker.

  1. Build the Docker image:

    docker build -t Coherence .
  2. Run the Docker container:

    docker run -p 8000:8000 Coherence

Note: The Dockerfile uses Python 3.9-slim as the base image and installs dependencies from requirements.txt. It runs the specified Python script when the container starts.


📡 API Endpoints

User Backend (user_backend.py)

Method Endpoint Description
POST /url Accepts a LinkedIn profile URL and returns missing skills and certifications.

Example Request

POST /url
{
  "url": "https://www.linkedin.com/in/sample-profile"
}

HR Backend (hr_backend.py)

Method Endpoint Description
POST /process-csv/ Accepts two CSV files (employee profiles and contestant profiles), calculates similarity scores, and returns ranked CSV of contestants.

Example Request

Upload two files in form-data:

  • file1: Employee profiles CSV
  • file2: Contestant profiles CSV

🚀 Usage

1️⃣ Fetching Company Data

Run prepare_company_data.py to collect LinkedIn profiles for employees. Results are saved in CSV format.

python prepare_company_data.py

2️⃣ Recommending Skills & Certifications

The /url endpoint in user_backend.py can be used to recommend skills and certifications. This can be run locally with uvicorn:

uvicorn user_backend:app --reload

Then, send a POST request:

curl -X POST "http://127.0.0.1:8000/url" -H "Content-Type: application/json" -d '{"url": "https://www.linkedin.com/in/sample-profile"}'

3️⃣ Ranking Contestants

To process contestant rankings, start the HR backend:

uvicorn hr_backend:app --reload

Then, send a request to /process-csv/ with two CSV files:

curl -X POST "http://127.0.0.1:8000/process-csv/" -F "file1=@path/to/employees.csv" -F "file2=@path/to/contestants.csv"

The response will contain a downloadable CSV file with contestants ranked by similarity.


🤝 Acknowledgments

This project uses:

About

Backend part of the Huawei-BTK R&D Coding Marathon 2024 finalist project of Shaolin Kesisleri

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published