movaindia
Methodology

How movaindia builds an answer

Seven steps, in order. Every one of them is in the source code, and every one of them is described here as it actually behaves — including where it stops.

The process

  1. Read the question. The question is read for its subject and its type. Words like "who", "when", "where", "how many" and their Hindi equivalents set what kind of answer is wanted; the remaining words become the subject to search for. A question with two parts is split, and each part is answered separately.
  2. Find the sources. The subject is searched twice — once with the whole question, once with just the subject words — because the two rank differently in English and in Hindi. The two lists are merged by rank. Which outside services are asked depends on the subject: a medical question reaches Europe PMC and PubMed, a computing one reaches DBLP, a space one reaches the NASA image library.
  3. Choose the article. The shortlist is compared against the question and the best match is kept. A title that merely shares a word with the question is not enough; similarity between the title and the subject counts.
  4. Sift the sentences. Every sentence of the chosen article is scored against the question by how rare and how relevant its words are. The score is then adjusted for what the question wants: a sentence carrying a plausible date wins a "when" question, one carrying a name wins a "who", a definition wins a "what". Citations, navigation boxes and "see also" sections are removed first, and page furniture — breadcrumbs, licence notes — is filtered out.
  5. Read outside the article. The same question is put to the text the outside services returned — a paper's abstract, a Wikisource or Wikibooks page, a definition — and ranked by the same method. A source contributes only when it genuinely answers; when none does, no section is shown.
  6. Build the answer. The strongest sentences become the direct answer, one to a line. The rest become the point-by-point list, each naming the section it came from. Dates and numbers taken from the article's own tables and infoboxes are shown as structured facts.
  7. Show the sources. Every answer names the article, the edition, the retrieval date and the page revision id, which pins the text to an exact version. Each point links to its section. Each outside source links to its own page.

What is deliberately not done

Where the limits are

How to check any of this

The whole method is in the public repository: github.com/galeoindus/movaindia. The ranking is in assets/js/rank.js and assets/js/answer.js, the source adapters are in assets/js/sources.js and assets/js/research.js, and the tests that check the answers are in tests/.

Try it See the sources