Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ Ratefluencer Copilot

The AI media-buyer that ranks business impact โ€” not follower count.

Ratefluencer AI Hackathon 2026 ยท Track 1 โ€” AI Influencer Intelligence Engine

Live Demo

Python LightGBM scikit-learn FAISS SHAP Streamlit React FastAPI Offline

Type a campaign brief in plain English โ†’ get a fraud-adjusted, ROI-ranked, explainable shortlist of creators + an exportable plan.

โ–ถ Live demo โ€” utkarsh805-ratefluencer-copilot.hf.space

(first analysis warms the models for ~40s, then it's instant)


๐Ÿš€ The 10-second pitch

Brands burn billions picking influencers by follower count. Follower count does not predict campaign success. Ratefluencer Copilot predicts the thing that actually matters โ€” business impact (ROI) โ€” sees through fake audiences, and explains every decision.

And it proves it on stage:

  #1   @minimal.skin     14K followers   ๐ŸŸข True-Impact 62   โœ… recommended
        โ‹ฎ  (real micro-creators with genuine engagement rank at the top)
  #22  @famous.face     512K โœ”verified   ๐Ÿ”ด True-Impact  6   ๐Ÿšฉ FLAGGED โ€” last
                                          ~54% bot audience โ†’ projected poor ROI

A 512K verified influencer ranked dead last. An unknown 14K creator wins. Follower count, inverted โ€” with proof. That's the reveal.


๐Ÿ“Š Verified results (held-out test set, seed = 42)

Trained on 30,000 synthetic creators ยท evaluated on 6,000 held-out creators.

Metric Result What it means
๐ŸŽฏ Precision@50 1.000 vs 0.320 every one of the top-50 picks is a genuine success โ€” vs 32% when ranking by followers
๐Ÿ“ˆ ROI Spearman 0.792 predicted ranking order strongly matches true ROI
โœ… Success ROC-AUC 0.963 cleanly separates campaign winners from losers
๐Ÿ›ก๏ธ Fraud F1 0.893 catches 97% of fraud (recall 0.974) without false alarms
๐Ÿ’ฐ Clean-creator ROI ~6.6ร— matches the published industry benchmark

๐Ÿ’ก Headline: ranking by True-Impact delivers ~3ร— the shortlist quality of follower-count ranking โ€” validated on 6,000 unseen creators.


๐Ÿง  Five models behind every score

Score Answers Powered by
๐ŸŽฏ True-Impact 0โ€“100 Will they drive ROI? LightGBM regressor + isotonic-calibrated classifier
๐Ÿ›ก๏ธ Authenticity 0โ€“100 Is the audience real? IsolationForest + tier-relative engagement deficit + rules
๐Ÿค Brand-Match 0โ€“100 Do they fit THIS brief? MiniLM embeddings + audience/category fit
๐ŸŒฑ Growth 0โ€“100 Are they rising? Momentum model over follower + engagement trend
๐Ÿ” Drivers + rationale Why this score? SHAP TreeExplainer + one-line explanation

Fraud is baked into impact, not bolted on. fraud_adjusted_reach = followers ร— (1 โˆ’ bot%) is a model input โ€” so a big account with a fake audience scores low by prediction, not by a hard rule. The reveal is a forecast, not a filter.


โšก Quick start

Try it live (no setup): utkarsh805-ratefluencer-copilot.hf.space โ€” or run it locally:

# 1 ยท install dependencies
py -m pip install -r requirements.txt

# 2 ยท build the demo data (creators + reveal cases + FAISS index + fraud scores).
#     Reuses the trained model โ€” does NOT retrain.
py models/prepare_demo.py

# 3 ยท launch the Streamlit app
py -m streamlit run app.py

๐ŸŒ Prefer the polished React UI?

The same pipeline is also served behind a thin FastAPI bridge (api.py), so a React + Vite single-page app can drive it. Run two terminals:

# terminal 1 ยท serve the models over HTTP
py -m uvicorn api:app --port 8000

# terminal 2 ยท run the React frontend (proxies /api โ†’ 127.0.0.1:8000)
cd web
npm install
npm run dev          # โ†’ http://localhost:5173

The React UI is fully responsive (tablet + mobile) and shares the same five screens โ€” brief โ†’ working โ†’ shortlist (the reveal) โ†’ creator detail โ†’ recommendation.

โœ… Runs 100% offline from seeded data โ€” no API key required. ๐Ÿ”‘ Optional: add GEMINI_API_KEY to a .env file (see .env.example) for LLM-written campaign summaries; without it, a built-in template is used. โฑ๏ธ First analysis โ‰ˆ 40s (one-time model + embedding warm-up), instant after.


๐Ÿ—๏ธ Architecture

Deterministic ML in the middle, LLM only at the edges. Every score is reproducible (global seed = 42). Two front-ends share one pipeline โ€” a responsive React/Vite SPA (web/) over a FastAPI bridge (api.py), and a Streamlit app (app.py) โ€” and the Data + ML layer is vendored in-repo at proj/, reached through a single bridge: models/score_creator.py.

System architecture

LAYER 4 โ€” PRESENTATION
   React + Vite SPA (web/, responsive)   ยท   Streamlit app (app.py, backup)
        |  HTTP  /api
        v
LAYER 3 โ€” API / AGENT
   FastAPI bridge (api.py)  ->  Orchestrator
   parse -> retrieve -> score -> rank -> compose  ---->  LLM rationale
                                                         (Gemini / offline template)
        |  models/score_creator.py   <- THE BRIDGE
        v
LAYER 2 โ€” INTELLIGENCE   (proj/)
   True-Impact . Authenticity . Brand-Match . Growth . SHAP
   LightGBM . IsolationForest . MiniLM embeddings . SHAP TreeExplainer
        |
        v
LAYER 1 โ€” DATA
   SQLite  (creators . features . authenticity)   +   FAISS vector index
   ^ built by the benchmark-calibrated, fraud-injected synthetic generator

AI workflow

   Brief (plain English)
   "DTC skincare . women 22-35 . India . Rs 3,00,000 . drive sales"
        |
        v
   1. PARSE       LLM -> category . audience . geo . budget . goal . tone
        |
        v
   2. RETRIEVE    embed brief -> FAISS -> top-K candidate creators
        |
        v
   3. SCORE       run 5 models on EACH candidate:
                    True-Impact    ROI / success (fraud-adjusted)
                    Authenticity   bot % . pods . spikes
                    Brand-Match    fit to this brief
                    Growth         momentum
                    SHAP           per-score drivers (the "why")
        |
        v
   4. RANK        weighted composite  +  fraud guardrail
                  (flagged creators sink to the bottom)
        |
        v
   5. COMPOSE     budget split + rationale (LLM, or offline template)
        |
        v
   Output: fraud-adjusted, ROI-ranked, EXPLAINABLE shortlist + export plan

Data flow

BUILD TIME  (one-time . python models/prepare_demo.py)
   synthetic generator ---> creators + labels (ROI, success)
                            + planted reveal (gem & fraud)
        |
        +--> feature engineering (17 features, fraud-adjusted) ---> SQLite
        +--> MiniLM embeddings ------------------------------------> FAISS index
        +--> authenticity engine (bot %, flags) ------------------> SQLite

QUERY TIME  (per brief)
   brief -> parse -> embed -> FAISS top-K
        |
        v
   load features (SQLite) -> 5 models -> scores + SHAP drivers
        |
        v
   rank (composite + fraud guardrail) -> recommendation
        |
        v
   shortlist + budget plan -> UI -> export (.txt)

๐Ÿ”ฌ Real-data proof (not just synthetic)

py models/screen_real.py    # screens real Instagram accounts from public numbers

The authenticity engine needs only public data (followers + engagement), so it runs on real accounts. It's tier-aware โ€” the clever part:

Account Followers Avg likes Engagement Verdict
@small.creator 40K 2,000 5.4% ๐ŸŸข clean
@big.account 800K 2,000 0.27% ๐Ÿ”ด flagged โ€” bots

Identical likes, opposite verdict โ€” because the model judges engagement relative to audience size. (Presented as an authenticity screen, not a public accusation.)


๐Ÿงช Why synthetic data? (stated openly โ€” it's a strength)

No public dataset has campaign outcomes. Conversions and ROI live inside brands' private CRMs. So we generate a labeled creator population calibrated to documented benchmarks (engagement-by-tier, ~6.6ร— industry ROI, verified-conversion uplift), with fraud injected into ~20% of profiles. We then validate fraud detection on real public accounts, where the data supports it.

"Real profiles for realism, a benchmark-calibrated synthetic generator for outcome labels โ€” because no one publishes conversion data."


๐Ÿ“ Project structure

Ratefluencer-Engine/
โ”œโ”€โ”€ app.py                # Streamlit entry point + design system
โ”œโ”€โ”€ api.py                # FastAPI bridge โ€” serves the pipeline to the React UI
โ”œโ”€โ”€ ui/                   # 5 screens: brief โ†’ working โ†’ shortlist โ†’ detail โ†’ export
โ”‚                         #   + real_screener.py (real-account fraud screen)
โ”œโ”€โ”€ web/                  # React + Vite SPA โ€” same 5 screens, responsive (calls api.py)
โ”œโ”€โ”€ agent/                # orchestrator ยท brief_parser ยท retriever ยท ranker ยท composer
โ”œโ”€โ”€ models/               # โญ ML BRIDGE: score_creator ยท prepare_demo ยท screen_real
โ”œโ”€โ”€ proj/                 # vendored Data + ML layer: config + src/{store,data,models} + trained model
โ”œโ”€โ”€ utils/                # session ยท env loader ยท ui_kit ยท ranking
โ””โ”€โ”€ data/                 # built by prepare_demo (gitignored)

โ„น๏ธ The Data + ML layer is vendored in proj/ (source + trained model), so a fresh clone is self-contained. Run py models/prepare_demo.py once to build the demo data, then launch. (Override its location with the RATEFLUENCER_PROJ env var if you keep the ML layer elsewhere.)


๐Ÿ† How it maps to the judging rubric

Category Pts How we earn them
AI / ML Innovation 20 Fraud-adjusted True-Impact + anomaly detection + SHAP + embeddings
Scoring Accuracy 20 Precision@50 1.000 vs 0.32, validated on 6,000 held-out creators
Viral Prediction 15 ROI + success probability + growth-potential model
Agent Design 15 Brief โ†’ retrieve โ†’ score โ†’ rank โ†’ recommend
Product Design 10 Decision-first UI + the reveal
Business Impact 10 Quantified wasted-spend savings (fraud โ†’ poor ROI)
Technical Complexity 5 5-model stack + vector search + synthetic-data engine
Demo 5 Rehearsed reveal + live real-account screen

Built for Ratefluencer AI Hackathon 2026 ยท Predict influence before it happens.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages