David Lindgreen

Annual-Report Research Assistant: method note

Version 1.0 · 2026-11-01 · not independently reviewed

A question-answering tool over the FY2025 Forms 20-F of Novartis, AstraZeneca and GSK that returns a quoted source passage with a link, a calculation from a reconciled dataset, or a refusal. It contains no language model. It was evaluated on 142 hand-written questions in five sets, each run on three versions of the engine, with the engine frozen before blind sets were run. Performance is moderate and fragile to wording; the failures are listed.

Question and why it matters

Question. Can a transparent retrieval system with a calculator and an explicit scope guard answer factual questions about annual reports with a traceable source, and how does it fail?

Why it matters. Fluent chat tools answer without a source and can be wrong. An analyst needs an answer that points to the filing, a number that can be recomputed, and a clear refusal when the documents cannot support an answer. How such a system is tested matters as much as how it is built.

How it was built. Designed and directed by David Lindgreen. The code was written with AI assistance (Claude). It is checked by the unit tests and filing checks described here and was not independently reviewed by a person outside the project.

Data

  • Three FY2025 Forms 20-F from the SEC (Novartis, AstraZeneca, GSK), retrieved 2026-10-20, cut into 3,214 passages that keep a section path and the nearest element link in the filing. No page numbers are used because the SEC HTML has none.
  • The reconciled dataset of the Pharma Valuation Explorer, used by the calculator.
  • Five question sets written by the author: a development set (41), held-out set 1 (26), held-out set 2 (30, paraphrased), held-out set 3 (21, blind, paraphrased, written before version 2 existed) and set 4 (24, paraphrased plus scope probes, written before version 2.1 was run on it).

Method

  • Three stages, none of which generates text. (1) A scope guard refuses investment advice, live prices, forecasts and companies outside the corpus. (2) A deterministic calculator answers numerical questions (margins, cash flow, net debt, tax rate, growth, comparisons) from the reconciled dataset and shows the formula. (3) Retrieval ranks passages with BM25 and refuses when the best passage lacks the question's key terms.
  • Version 2 adds Porter stemming, a small hand-written thesaurus and corpus-derived neighbours treated as the same idea at a discount, and a bonus for query words that sit together. Version 2.1 tightens the scope guard after an outside probe showed an off-topic question was answered with unrelated passages.
  • Evaluation: each question has a gold answer or an expected refusal. Questions are scored as correct, wrongly answered, wrongly refused or correctly refused; lookups are also scored by whether the right passage is first or in the top five. The engine is frozen before each blind set is run, and every version is run on every set so changes can be compared.

Results

  • Development set (41): 28/41 correct with version 2.1 (95% interval 53% to 80%).
  • Held-out set 1 (26): 23/26 correct with version 2.1 (95% interval 71% to 96%).
  • Held-out set 2, paraphrased (30): 18/30 correct with version 2.1 (95% interval 42% to 75%).
  • Held-out set 3, paraphrased (21): 10/21 correct with version 2.1 (95% interval 28% to 68%).
  • Set 4, paraphrased plus scope probes (24): 13/24 correct with version 2.1 (95% interval 35% to 72%).
  • Version 2 raised the paraphrased held-out set 2 from 7/30 to 18/30 but lowered the original development set from 31/41 to 27/41, because it let two unanswerable questions through. Tuning on a set improves that set and can hurt another, which is why blind sets were written first.
  • Lookups remain the weak point: the right passage is often in the top five but not first, and some paraphrases are missed entirely. The intervals are wide because each set has 21 to 41 questions, so a difference of a few questions is within chance.

Validation

  • 20 unit tests cover the scope guard, the calculator, the retrieval and refusal thresholds and the stemmer.
  • Gold answers were written with AI assistance and checked by the author's reading; the author's own line-by-line check of every gold answer is not recorded.
  • An external AI-assisted technical check reviewed the evaluation and its corrections were adopted. It is not an independent human audit.

Threats to validity

  • The author wrote the questions, the gold answers and the thesaurus, so the evaluation is not independent of the system's design. Blind sets reduce but do not remove this.
  • Five small question sets, one corpus of three filings, three companies in one sector: results may not transfer to other filings or other wording.
  • Passages are cut by a heuristic; a passage boundary can split an answer.
  • BM25 and the refusal thresholds were tuned by hand on earlier sets.

What was not checked

  • A second question writer.
  • A comparison with a language-model baseline.
  • Human relevance judgments of the retrieved passages.

Reproduce

Run from the website folder of the repository. The raw SEC files are not stored in the repository; the fetch scripts download them with a declared contact in the User-Agent, as the SEC asks. Needs Node 24 or later; the workbook steps need Python and, to recalculate, Microsoft Excel.

python -I tools/research/extract-passages.py
node tools/research/eval.ts
node --test tests/research/research.test.ts

References

The standard sources for the methods used, given as background. This is not a literature review.

  1. Robertson, S. and Zaragoza, H. (2009). The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4), 333-389.
  2. Porter, M. F. (1980). An algorithm for suffix stripping. Program, 14(3), 130-137.
  3. Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209-212.
  4. Brown, L. D., Cai, T. T. and DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133.

Version and citation

Version history
VersionDateChange
1.02026-11-01Method note, Wilson intervals on the evaluation table, evaluation stated as not independent of the design.
0.42026-10-23Version 2.1 scope guard frozen; set 4 written before the engine was run on it; corrections from the technical verification.
0.32026-10-23Version 2 retrieval (stemming, thesaurus, neighbours, phrase bonus); blind sets 2 and 3.
0.12026-10-21First release: scope guard, calculator, BM25 retrieval; development and held-out set 1.

Cite as: David Lindgreen (2026). Annual-Report Research Assistant: method note, version 1.0. https://lindgreendavid.com/projects/research-assistant/method/

Educational work. Not investment advice, not a credit rating and not a valuation of any company.