Answering questions from 518 Lao legal documents
How Lao Info finds the right article in Lao laws and decrees, and why exact legal wording beat clever search for this job.
- AI
- Lao Info
- Search
- Lao language
Lao Info answers questions about Lao laws, decrees and decisions — in Lao or English — and every answer cites the article it comes from. Behind it are 518 public documents split into 23,249 articles. This note explains how it works and what we learned.
From scans to articles
Most official documents exist only as scanned PDFs. We converted them to text with an AI model, a few pages at a time, because one long request could come back empty. Each document was then split by article (ມາດຕາ), so a search result is one article with its number, never half a page. Documents that no person has checked yet are marked as such on their page, and the printed document stays the authority.
Lao has no spaces between words
Lao writes words together, so splitting a question on spaces gives whole phrases instead of words. We use two steps:
- A small, cheap model turns the question into Lao search terms that are likely to appear word for word in the law, plus any document numbers it mentions.
- If that fails, the browser-standard word segmenter for Lao (
Intl.Segmenter) splits the question, and pairs of neighbouring words are used, because pairs are far more specific than single syllables.
One spelling for the same letters
Lao text on computers often has two encodings for the same letter: ໍາ or ຳ, ຫນ or ໜ, ຫມ or ໝ. A search for one spelling misses the other. Questions and documents are normalised to one form before they are compared — a small rule with a large effect.
Exact wording first
For law, the words that matter are exact: the name of a tax, a licence or an office. A Postgres search function looks for the terms in article bodies, article titles and document titles, scores the matches and returns the best 12 articles. Only those articles go to the answering model, which must answer from them and cite them as [S1], [S2]… Each citation links to the exact article, so the visitor can read the source.
Rules that matter more than the model
- Answer only from the found articles. If nothing relevant is found, say so instead of guessing.
- Show the source for every statement.
- Information, not legal advice — said on every answer.
- A spending limit: free questions every day and a hard daily budget.
What is next
Meaning-based (vector) search will help when the question uses everyday words that the law does not. We will add it next to the exact search, not instead of it — and measure both on a set of real questions in Lao and English before switching anything.