aniketsirsikar commited on
Commit
464abf1
·
verified ·
1 Parent(s): 03ba743

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +143 -6
README.md CHANGED
@@ -1,12 +1,149 @@
1
  ---
2
- title: FinLit App V0
3
- emoji: 😻
4
  colorFrom: yellow
5
- colorTo: pink
6
  sdk: gradio
7
- sdk_version: 6.8.0
8
  app_file: app.py
9
- pinned: false
 
 
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Hindi Banking Voice Assistant
3
+ emoji: 🏦
4
  colorFrom: yellow
5
+ colorTo: green
6
  sdk: gradio
7
+ sdk_version: 4.44.0
8
  app_file: app.py
9
+ pinned: true
10
+ license: mit
11
+ suggested_hardware: cpu-basic
12
+ short_description: Hindi voice assistant for banking & govt schemes
13
  ---
14
 
15
+ # 🏦 बैंकिंग सहायक Hindi Banking Voice Assistant
16
+
17
+ A voice-powered AI assistant for Indian users to understand banking, loans, and government financial schemes — entirely in **Hindi**. Runs on **CPU Basic** (free tier) via HF Inference API.
18
+
19
+ ## 🔑 Setup (Required — One Time)
20
+
21
+ 1. Go to your Space → **Settings → Secrets**
22
+ 2. Add secret → **Name:** `HF_TOKEN` | **Value:** your free HF read token from [hf.co/settings/tokens](https://hf.co/settings/tokens)
23
+
24
+ That's it. All 3 models are called via API — nothing loads into the Space's RAM.
25
+
26
+ ---
27
+
28
+ ## 🤖 Models Used
29
+
30
+ | Role | Model |
31
+ |------|-------|
32
+ | Speech-to-Text | `openai/whisper-large-v3-turbo` |
33
+ | LLM | `Telugu-LLM-Labs/Indic-gemma-7b-finetuned-sft-Navarasa-2.0` |
34
+ | Text-to-Speech | `ai4bharat/indic-parler-tts` |
35
+
36
+ ---
37
+
38
+ ## 🔄 Pipeline
39
+
40
+ ```
41
+ 🎤 Hindi Audio
42
+
43
+ [HF API] openai/whisper-large-v3-turbo → Hindi transcript
44
+
45
+ Jargon Normalization (local, pure Python) → kist→EMI, zamanat→collateral ...
46
+
47
+ Keyword RAG Retrieval (local, pure Python) → top 3 relevant KB passages
48
+
49
+ [HF API] Indic-gemma-7b (Navarasa 2.0) → Hindi answer grounded in KB
50
+
51
+ [HF API] ai4bharat/indic-parler-tts → Hindi speech audio
52
+
53
+ 🔊 Answer (audio + text + citations)
54
+ ```
55
+
56
+ **Local compute:** ~50 MB RAM for knowledge base + retriever. Zero GPU required.
57
+
58
+ ---
59
+
60
+ ## ⏱️ Expected Response Times (free tier)
61
+
62
+ | Step | Time |
63
+ |------|------|
64
+ | STT (Whisper API) | 5–10s |
65
+ | RAG Retrieval | < 1s |
66
+ | LLM (Indic-Gemma API) | 15–40s (cold start up to 60s) |
67
+ | TTS (Parler API) | 10–20s |
68
+ | **Total** | **~30–70s per query** |
69
+
70
+ > First call may be slower due to HF cold start. The app retries automatically.
71
+
72
+ ---
73
+
74
+ ## 📖 Knowledge Base Coverage
75
+
76
+ ### Banks (12)
77
+ SBI, HDFC Bank, ICICI Bank, Axis Bank, Kotak Mahindra Bank, PNB, Bank of Baroda, Canara Bank, Union Bank of India, Indian Bank, Small Finance Banks (AU / Ujjivan / Equitas / Jana), Regional Rural Banks & Co-operative Banks, NBFCs (Bajaj Finance / Muthoot / Manappuram)
78
+
79
+ ### Government Credit Schemes (11)
80
+
81
+ | Scheme | Coverage |
82
+ |--------|----------|
83
+ | PM Mudra Yojana | Shishu / Kishore / Tarun loans up to ₹10L (Tarun Plus ₹20L) |
84
+ | Stand-Up India | SC/ST & women entrepreneurs ₹10L–₹1Cr |
85
+ | PM SVANidhi | Street vendors ₹10K → ₹20K → ₹50K |
86
+ | PMEGP + KVIC | Employment generation with 15–35% govt subsidy |
87
+ | CGTMSE + ECLGS | Collateral-free MSME loans |
88
+ | PM Awas Yojana CLSS | Home loan interest subsidy for EWS / LIG / MIG |
89
+ | Kisan Credit Card | Agricultural credit at effective 4% p.a. |
90
+ | PM Vishwakarma | Artisan loans at 5% concessional rate |
91
+ | PMJDY + Overdraft | Zero-balance accounts + ₹10,000 overdraft |
92
+ | Vidya Lakshmi + CSIS | Education loans + interest subsidy |
93
+ | NRLM-SHG | Women Self Help Group bank linkage program |
94
+
95
+ ### Social Security Schemes (6)
96
+
97
+ | Scheme | Benefit |
98
+ |--------|---------|
99
+ | PMJJBY | ₹2 lakh life insurance at ₹436/year |
100
+ | PMSBY | ₹2 lakh accident insurance at ₹20/year |
101
+ | Atal Pension Yojana | Guaranteed monthly pension for unorganized sector |
102
+ | PM-KISAN | ₹6,000/year direct income support for farmers |
103
+ | EPFO / EPF / EPS | Provident fund & pension for formal employees |
104
+ | PMFBY | Crop insurance at 1.5–2% farmer premium |
105
+ | MGNREGS | 100 days guaranteed employment per year |
106
+
107
+ ### Financial Terms & Concepts
108
+ EMI, CIBIL Score, KYC documents, MCLR & Repo Rate, Collateral & Guarantor, Moratorium & Loan Restructuring, Processing Fees & Prepayment Charges, NPA & OTS, Loan types (home / personal / vehicle / gold / education / LAP), UPI / NEFT / RTGS, FD / RD, Microfinance (JLG / SHG), Consumer Rights & RBI Ombudsman
109
+
110
+ ---
111
+
112
+ ## 📁 Repository Structure
113
+
114
+ ```
115
+ app.py Gradio app + HF Inference API pipeline (STT → RAG → LLM → TTS)
116
+ rag_pipeline.py Jargon normalization map, keyword retriever, prompt builder
117
+ knowledge_base.py 40+ documents in English (retrieved, answers given in Hindi)
118
+ requirements.txt Minimal: gradio, requests, soundfile, numpy
119
+ README.md This file (HF Space config + documentation)
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 💡 Design Principles
125
+
126
+ - **Grounded answers only** — LLM responds only from retrieved KB content, not hallucinations
127
+ - **Always in Hindi** — STT, LLM prompt, and TTS all enforce Hindi throughout
128
+ - **One follow-up at a time** — conversational, not overwhelming
129
+ - **Spoken-friendly output** — short sentences, no technical jargon in answers
130
+ - **Graceful fallback** — says "बैंक से संपर्क करें" when information is unavailable
131
+ - **Extensible** — adding a new language requires only changing STT language code + TTS voice description
132
+
133
+ ---
134
+
135
+ ## 📝 Example Questions
136
+
137
+ - मुझे होम लोन के लिए कौन से दस्तावेज़ चाहिए?
138
+ - EMI क्या होती है और कैसे calculate होती है?
139
+ - मुद्रा लोन कैसे मिलेगा?
140
+ - CIBIL score क्या होता है?
141
+ - PM Awas Yojana में subsidy कैसे मिलती है?
142
+ - जन धन खाता कैसे खोलें?
143
+ - किसान क्रेडिट कार्ड क्या है?
144
+ - महिला स्वयं सहायता समूह को loan कैसे मिलेगा?
145
+
146
+ ---
147
+
148
+ > ⚠️ **Disclaimer:** This assistant provides general information only. For actual financial decisions, please consult your bank or a certified financial advisor.
149
+ > यह assistant केवल सामान्य जानकारी देता है। वित्तीय निर्णयों के लिए अपने बैंक या certified advisor से सलाह लें।