How devbaghel-02/kisan-helpline works
Kisan Helpline takes farmer questions through a web interface or keypad-phone call, identifies crop, mandi, intent and date, then returns a grounded Punjabi or Hindi response as text and speech. Its distinct answer branches cover mandi prices, weather forecasts and government schemes; admins can upload price data and inspect query logs. Phone calls share the answering pipeline, while the simulator adds phone-quality audio processing. The graph follows the README and sampled excerpts; unsampled route details are represented only where documented.
Main entry points: main.py FastAPI Routes · pipeline.py Answer Pipeline · data.py Price Database · intent.py Intent and Slots
Components 20
Farmer Interfaces
- Farmer Website
static/index.html - Phone Simulator UI
static/phone.html - Admin Panel
static/admin.html - FastAPI Routes
app/main.py
Call Handling
- Phone Call Flow
app/phone.py - Phone Audio Filter
app/phoneline.py
Question Understanding
- Answer Pipeline
app/pipeline.py - Speech ASR and TTS
app/speech.py - Intent and Slots
app/intent.py - Fuzzy Normalisation
app/normalise.py - Crop and Mandi Synonyms
data/synonyms.json
Grounded Answers
- Grounded Answer Builder
app/answer.py - Weather Forecasts
app/weather.py - Scheme Catalogue
data/schemes.json
Data and Admin
- Price Database
app/data.py - Sample Price Data
data/sample_prices.csv - Environment Config
app/config.py
Other components
- Farmer
- Weather Providers
- Speech Providers
Connections 28
- Farmer → Farmer Website: asks through
README.md - Farmer → Phone Simulator UI: asks through
README.md - Farmer → Admin Panel: manages data
README.md - Farmer Website → FastAPI Routes: submits questions
README.md - Phone Simulator UI → FastAPI Routes: uses simulator
README.md - Admin Panel → FastAPI Routes: uploads CSV
app/main.py - FastAPI Routes → Answer Pipeline: routes questions
app/main.py - FastAPI Routes → Phone Call Flow: mounts routes
app/main.py - FastAPI Routes → Price Database: imports and logs
app/main.py - FastAPI Routes → Intent and Slots: refreshes matchers
app/main.py - FastAPI Routes → Environment Config: loads settings
app/main.py - Phone Call Flow → Answer Pipeline: answers recordings
app/phone.py - Phone Call Flow → Phone Audio Filter: filters simulator audio
app/phone.py - Phone Call Flow → Speech ASR and TTS: plays generated audio
app/phone.py - Answer Pipeline → Speech ASR and TTS: transcribes and speaks
app/pipeline.py - Answer Pipeline → Intent and Slots: parses alternatives
app/pipeline.py - Answer Pipeline → Grounded Answer Builder: builds response
app/pipeline.py - Answer Pipeline → Price Database: logs query
app/pipeline.py - Intent and Slots → Fuzzy Normalisation: matches text
app/intent.py - Intent and Slots → Price Database: loads market names
app/intent.py - Intent and Slots → Crop and Mandi Synonyms: uses vocabulary
README.md - Grounded Answer Builder → Price Database: reads prices
app/answer.py - Grounded Answer Builder → Weather Forecasts: requests forecast
app/answer.py - Grounded Answer Builder → Scheme Catalogue: reads scheme facts
README.md - Weather Forecasts → Weather Providers: fetches forecast
app/weather.py - Speech ASR and TTS → Speech Providers: uses ASR and TTS
README.md - Admin Panel → Price Database: reviews logs
README.md - Sample Price Data → Price Database: provides sample rows