CoolFace
Apppublic

nishant19138/cpg-taxonomy-classifier

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
App README

CPG Taxonomy Classifier

LLM-backed classifier that maps procurement contract names to a strict 3-level CPG taxonomy (L1 → L2 → L3). Built for team use: per-user login, admin-moderated knowledge base, file-uploaded taxonomy, multi-provider LLM support (Groq, OpenAI, Anthropic, Gemini), and per-contract semantic + fuzzy retrieval with cross-encoder rerank.

Run locally

powershell
.venv\Scripts\python -m pip install -r requirements.txt
.venv\Scripts\python -m streamlit run app.py

Sign in with one of the seeded demo accounts (admin / admin123, alice / alice123, bob / bob123, carol / carol123). Admins can replace the taxonomy, manage API keys, curate the knowledge base, and manage users.

Deployment

See DEPLOY.md for a step-by-step deploy checklist for Hugging Face Spaces. Other platforms work too — anything that can run a persistent Python process with ~2 GB RAM, mount a writeable disk for data/, and inject env-var secrets (GROQ_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY).

Environment variables

VarPurpose
GROQ_API_KEYRequired for the default Groq providers.
OPENAI_API_KEYOptional — enables the OpenAI provider.
ANTHROPIC_API_KEYOptional — enables the Claude provider.
GOOGLE_API_KEYOptional — enables the Gemini provider.
APP_DATA_DIRPath where state files live (users.json, knowledge_base.json, taxonomy.xlsx, embeddings, result cache). Defaults to <project>/data/. Point at a mounted persistent volume in production.