Extract people, places, organizations, time expressions, and more from any text —
surfaced through a polished React UI and a high-performance FastAPI inference backend.
🌐 Live Demo: patmoleo.vercel.app
⚙️ API Docs: alexcj10-patmoleo.hf.space/docs
- Named Entity Recognition — identifies 8 entity types (person, location, organization, time, geopolitical, artifact, event, natural phenomenon) using BIO tagging across 17 labels
- Fine-tuned Transformer — DeBERTa-v3-small adapted with LoRA for efficient, accurate token classification (F1: 0.96 weighted)
- Glassmorphism UI — smooth animations, dynamic color-coded entity highlighting, and a fully responsive layout
- Mobile-First — bottom-sheet history panel and search optimized for small screens
- Fast Inference API — async FastAPI backend with a single
/predictendpoint returning structured JSON - Production-Ready — frontend on Vercel, backend on Hugging Face Spaces (Docker)
| Tag | Entity Type | Example |
|---|---|---|
per |
Person | Alex, Barack Obama |
geo |
Geographical Location | London, Mt. Everest |
org |
Organization | Google, United Nations |
tim |
Time Expression | Tuesday, 2026, morning |
gpe |
Geopolitical Entity | Indian, USA |
art |
Artifact | Harry Potter, Golden Gate Bridge |
eve |
Event | World War II, the Olympics |
nat |
Natural Phenomenon | Hurricane Katrina, Flu |
O |
Outside (non-entity) | Any regular word |
Each entity uses BIO tagging: B- marks the beginning of an entity span, I- marks continuation — giving 17 total labels.
Inference Example:
Input: "Alex went to London last Tuesday to visit Google."
Alex → B-per (Person)
London → B-geo (Geographical Location)
Tuesday → B-tim (Time)
Google → B-org (Organization)
| Version | Base Model | Dataset | Labels | Best F1 | Status |
|---|---|---|---|---|---|
| Patmoleo E1 | deberta-v3-base |
Synthetic Job Descriptions (CrewAI) | 8 custom | 0.998 | Deprecated |
| Patmoleo E2 | deberta-v3-small |
GMB NER (Kaggle, ~48K sentences) | 17 (8 types) | 0.608 macro / 0.96 weighted | ✅ Active |
| Epoch | Train Loss | Val Loss | Macro F1 |
|---|---|---|---|
| 1 | 1.666 | 1.107 | 0.448 |
| 2 | 0.803 | 0.561 | 0.531 |
| 3 | 0.589 | 0.460 | 0.551 |
| 4 | 0.580 | 0.398 | 0.525 |
| 5 ✓ | 0.428 | 0.323 | 0.609 |
| 6 | 0.360 | 0.296 | 0.590 |
Best checkpoint loaded from Epoch 5 (
load_best_model_at_end=True)
| Entity | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| B-geo | 0.83 | 0.91 | 0.87 | 3,788 |
| B-gpe | 0.93 | 0.93 | 0.93 | 1,537 |
| B-org | 0.77 | 0.61 | 0.68 | 2,013 |
| B-per | 0.80 | 0.83 | 0.82 | 1,701 |
| B-tim | 0.88 | 0.84 | 0.86 | 1,950 |
| B-eve | 0.67 | 0.36 | 0.47 | 28 |
| B-nat | 0.56 | 0.43 | 0.49 | 23 |
| B-art | 0.67 | 0.10 | 0.17 | 42 |
| O | 0.99 | 0.99 | 0.99 | 88,700 |
| Weighted Avg | 0.96 | 0.96 | 0.96 | 104,683 |
Rare classes (
art,nat,eve) pull down the macro average due to limited training examples. Frequent entity types perform excellently.
| Parameter | E1 | E2 |
|---|---|---|
| Base Model | deberta-v3-base |
deberta-v3-small |
Rank (r) |
16 | 16 |
Alpha (lora_alpha) |
32 | 32 |
| Dropout | 0.05 | 0.1 |
| Target Modules | query_proj, value_proj |
query_proj, value_proj |
| Task Type | TOKEN_CLS |
TOKEN_CLS |
Built with React, Vite, and raw CSS. Users input text and instantly see color-coded entity highlights. Features a bottom-sheet history panel with search, smooth animations, and glassmorphism styling.
Built with Python and FastAPI. Exposes a /predict endpoint that tokenizes input text, runs it through the fine-tuned DeBERTa pipeline, and returns structured JSON with entity spans, labels, and confidence scores.
- Node.js v18+
- Python 3.9+
# ⚠️ Replace with your actual GitHub repo URL
git clone https://github.com/YOUR_USERNAME/patmoleo.git
cd patmoleocd "backend/patmoleo E2/api"
pip install -r requirements.txt
uvicorn main:app --reload --host 127.0.0.1 --port 8000API will be available at http://localhost:8000 — visit /docs for the interactive Swagger UI.
Open a new terminal:
cd frontend
npm installCreate a .env.local file:
VITE_API_URL=http://localhost:8000Then run:
npm run devFrontend runs on http://localhost:5173.
- Create a new Docker Space on huggingface.co/spaces
- Clone the empty space repository locally
- Copy the contents of
backend/patmoleo E2(includingDockerfile,api/, and LoRA weights) into it git push— the Space builds and exposes your API automatically
- Push this repository to GitHub
- Import it in vercel.com
- Set Root Directory to
frontend - Add the environment variable:
VITE_API_URL = https://your-space-name.hf.space - Deploy — Vercel auto-deploys on every push to
main
| Layer | Technology |
|---|---|
| Model | Microsoft DeBERTa-v3-small |
| Fine-Tuning | Hugging Face Transformers + PEFT (LoRA) |
| Training | Kaggle (T4 GPU) |
| Evaluation | scikit-learn |
| Backend API | FastAPI + Uvicorn |
| Backend Hosting | Hugging Face Spaces (Docker) |
| Frontend | React + Vite + raw CSS |
| Frontend Hosting | Vercel |
Patmoleo E1 was originally built to parse job descriptions — extracting entities like company, role, location, and salary using AI agents. However, scraping job boards led to aggressive bot bans, and synthetically generated training data (via CrewAI) failed to generalize to real-world text.
Patmoleo E2 pivoted to standard NER using the high-quality GMB (Groningen Meaning Bank) dataset, achieving strong performance on the most common entity types.
Future plans:
- Secure a real-world job description dataset and revisit E3 for domain-specific NER
- Experiment with larger base models (
deberta-v3-large) and extended training - Add confidence score visualization to the UI
This project is open source and available under the MIT License.
Built with ☕ and way too many training epochs.