Ghost Papers:離線 AI 閲讀並解釋家人留下的文件
Ghost Papers: an offline AI that reads and explains the papers a family leaves behind
Ghost Papers 使用本機運行的 Gemma 3 (4B) 閲讀家人留下的文件,並整理成一份遺產檔案和可列印的家庭文件冊。它透過 Ollama 離線運作,毋須 API key 或雲端服務;個人資料可只保留在記憶體中,儲存則由用戶選擇。文件內容支援英語、孟加拉語和印地語,但孟加拉語和印地語文件仍須對照原件核實。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
When someone dies, or falls ill, a family opens one drawer. Passbooks. Insurance policies. A land record. An ID card. Nobody knows what exists, what is due, or who to call. The papers are the ghosts that stay behind.
Ghost Papers reads those papers, explains each one in plain English, বাংলা or हिन्दी, and files everything into one legacy file:
- what exists (accounts, policies, records), with account numbers hidden by default
- the dates that matter (passed, soon, upcoming)
- next steps for each kind of paper, written by a person, not generated
- honest gaps, like "no nominee found" or "no identity paper added yet"
- contacts found on the papers
- a printable family binder to keep in the drawer
Every fact has a receipt: tap it and you see the exact line that was read from the picture.
I read "honouring the past" literally. These are the papers a person left behind, and the job is to treat them carefully, in a family's own language, without sending them anywhere.
Demo
Code
Ghost Papers
Every paper a loved one left behind: read, explained and filed. In your own language. On your own computer.
When someone passes away or falls ill, the family finds a drawer of papers: passbooks, insurance policies, pension slips, land records, ID cards. Nobody knows what exists, what is due, or who to call. Ghost Papers turns the pile into one legacy file and a printable family binder.
Built for the DEV Hacktoberfest "Ghost in the Machine" week: the papers are the ghosts, and the tool honours the person who left them.
What it does
- Read: drop photos or PDFs (Bengali, Hindi, English). Gemma vision reads them locally.
- Explain: plain English, বাংলা or हिन्दी. Every fact has a receipt (the exact line it came from).
- File: accounts, policies and records, dates that matter, contacts, next steps per paper type, and honest gaps (for example "no nominee…
How I Built It
- Gemma 3 (4B) through Ollama, running locally. Gemma's vision reads each picture, and a second call turns the text into strict JSON. No API key, no cloud, $0.
- FastAPI backend, plain HTML/JS front end, Pillow, pypdf and pypdfium2 for pictures and PDFs. Gemma shrinks pictures to about 896 px, so I cut each paper into overlapping tiles and merge the lines.
- The model proposes, the code checks. Every name, number and date must be found in the text that was read, or it is dropped, and the app shows how many claims it blocked. Numbers and dates are normalised (Bengali and Devanagari digits included). The summary language is script-checked. If Ollama is down, a simple regex reading still works, clearly labelled.
-
Privacy: cases live in memory only. Pictures are read, then dropped. Saving is opt-in, local, and stores masked identifiers with no pictures and no full text. A last-line
scrub()removes any raw identifier before anything is written. - 17 automated tests, including privacy checks that caught my own leak: raw account numbers were reaching the saved file through the receipts, so I added the scrub step.
Why Does Open Innovation Matter?
These are the most private papers a family owns: bank accounts, insurance, land. Uploading them to a closed API just to get an explanation is a bad trade, and for many families it is not an option at all. With an open-weight model on your own laptop, the papers never leave it, it works with the internet off, I can change how the model is asked, and nobody can shut it down.
Where it was worse, honestly. I ran the real gemma3:4b on my four fictional samples. The English insurance policy and PAN card were read correctly. The Bengali land record was not: some letters broke, and the plot number came out as ০৮৭৯ instead of ৩৮৭. A larger closed model would probably read Bengali better. That is why the app marks Bengali and Hindi papers with a "check against the paper" badge, why every fact has a receipt, and why the README says so. I would rather show the limit than hide it.
The Spirit of It
Día de los Muertos is about keeping people present through the things they left. For a family in India, that is often a drawer of paper in three languages. I wanted the tool to be gentle with it: plain words, your own language, nothing sent away, nothing saved unless you choose.
Prize Categories
Best Use of Gemma. Gemma 3 (4B) with vision runs locally through Ollama and does both the reading (OCR from pictures, including Bengali and Hindi) and the structured extraction, with code checks around it.
Ghost Papers organises papers. It is not a lawyer or a bank and gives no legal or financial advice. Always confirm with the institution named on the paper.
Built by Subhasish Das
來源:DEV Community · dev.to