1from finee import extract
2
3r = extract("Rs.2500 debited from A/c XX3545 to swiggy@ybl on 28-12-2025")
4
5print(r.amount) # 2500.0
6print(r.merchant) # "Swiggy"
7print(r.category) # "food"
1from finee import FinEE
2from finee.schema import ExtractionConfig
3
4# Downloads 7GB model once, then runs locally
5extractor = FinEE(ExtractionConfig(use_llm=True))
6result = extractor.extract("Your complex bank message...")
1{
2 "amount": 2500.0, // float - Always numeric
3 "currency": "INR", // string - ISO 4217
4 "type": "debit", // "debit" | "credit"
5 "account": "3545", // string - Last 4 digits
6 "date": "28-12-2025", // string - DD-MM-YYYY
7 "reference": "534567891234",// string - UPI/NEFT ref
8 "merchant": "Swiggy", // string - Normalized name
9 "category": "food", // string - food|shopping|transport|...
10 "confidence": 0.95 // float - 0.0 to 1.0
11}
1git clone https://github.com/Ranjitbehera0034/Finance-Entity-Extractor.git
2cd Finance-Entity-Extractor
3pip install finee
4python benchmark.py --all
Input Text
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TIER 0: Hash Cache (<1ms if seen before) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TIER 1: Regex Engine (50+ patterns) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TIER 2: Rule-Based Mapping (200+ VPA → merchant) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TIER 3: Phi-3 LLM (Optional - downloads 7GB model) │
│ Only called for edge cases │
└─────────────────────────────────────────────────────────────┘
│
▼
ExtractionResult (Guaranteed Schema)
Finance-Entity-Extractor/
├── src/finee/ # Core package
├── tests/ # 88 unit tests
├── examples/demo.ipynb # 👈 Try in Colab!
├── benchmark.py # Verify accuracy
├── CHANGELOG.md # Release history
└── CONTRIBUTING.md # How to contribute