CoolFace
Apppublic

MikaelMonjour/outbound-lead-scoring-v2

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Lead Scoring API

A FastAPI application that calculates a lead score based on multiple weighted parameters. The API is stateless and deployed on Hugging Face Spaces.

Features

  • Intelligent Lead Scoring: Calculates scores based on carefully weighted parameters
  • Business Type Analysis: Prioritizes hospitality businesses with higher scores
  • Status Awareness: Automatically filters out permanently closed businesses
  • Technical Validation: Checks for MX records on websites to verify legitimacy
  • Categorization System: Classifies leads as Hot, Warm, or Cold for easy prioritization
  • Interactive Documentation: Includes Swagger UI for easy testing and integration
  • Stateless Architecture: Designed for scalability and reliability

Input Parameters

The API accepts a JSON payload with the following fields:

ParameterTypeDescriptionWeight
typestringBusiness type (e.g., "Beauty salon")30%
business_statusstringBusiness status ("OPEN", "CLOSEDTEMPORARILY", "PERMANENTLYCLOSED")Binary filter
websitestringBusiness website URL10%
phone_numberstringBusiness phone number10%
emailstringBusiness email (not used in scoring)0%
ratingfloatBusiness rating (0-5)10%
review_countintegerNumber of reviews40%

Scoring Logic

The lead score is calculated using a sophisticated algorithm:

  1. 1.Business Type Evaluation:
  2. 2.Hospitality businesses (salons, restaurants, hotels, etc.) receive maximum points
  3. 3.Other businesses receive a moderate score
  1. 1.Status Check:
  2. 2.Permanently closed businesses automatically receive a score of 0
  3. 3.Open or temporarily closed businesses proceed to full evaluation
  1. 1.Weighted Calculation:
  2. 2.Each parameter contributes to the final score based on its assigned weight
  3. 3.Review count is logarithmically scaled to handle wide ranges of values
  1. 1.Categorization:
  2. 2.Hot if score ≥ 7
  3. 3.Warm if 4 ≤ score ≤ 6
  4. 4.Cold if score < 4

API Endpoints

  • POST /calculate-score: Calculate a lead score based on the provided data
  • GET /: API information
  • GET /docs: Swagger documentation

Input Parameters

The API accepts a JSON payload with the following fields:

json
{
  "type": "Business type (e.g., 'Beauty salon')",
  "business_status": "Business status (OPEN, CLOSED_TEMPORARILY, or PERMANENTLY_CLOSED)",
  "website": "Business website URL (optional)",
  "phone_number": "Business phone number (optional)",
  "email": "Business email (not used in scoring, optional)",
  "rating": "Business rating 0-5 (optional)",
  "review_count": "Number of reviews (optional)"
}

Log git updates to Hugging Face Space

Last GitHub commits:

7392610 - refactor: replace DNS MX record check with static domain validation using common TLDs (MikaelGrowthEngineer, il y a 13 minutes)
89db14d - docs: add section about logging git updates to Hugging Face Space (MikaelGrowthEngineer, il y a 37 minutes)
e18b7a2 - Modify reviews score allocation of points and creating documentation files (MikaelGrowthEngineer, il y a 4 mois)
8ec6763 - Adapt README.md for hugging 3 (MikaelGrowthEngineer, il y a 6 mois)
bea23df - Adapt README.md for hugging 2 (MikaelGrowthEngineer, il y a 6 mois)