How issue scoring works today
src/mk_tracking/bigquery_issue_scoring.py embeds each post, takes the maximum cosine similarity across that issue's 8 hand-curated multilingual anchors, then applies a softmax at temperature 0.07 across all issues. Anchors live in db/issue_anchors.json.
The proposal
Replace that with a single gemini-flash-lite structured-output call per post, scoring the post against the issue list directly.
Measure before implementing
The original issue asserted that this "should improve performance and only slightly increase costs". Neither claim has been tested, and both are load-bearing. Before writing the replacement:
- Build a labelled sample of posts — a few hundred, covering all issues and both Hebrew and Arabic.
- Measure agreement between the current scorer and the proposed one against those labels.
- Measure cost per 1,000 posts and wall-clock latency for both, at the volumes the pipeline actually runs at.
- Consider what is lost: the current approach is deterministic and reproducible for a fixed model version. An LLM call is neither, which matters for a site making public claims about named politicians.
If the numbers do not favour the change, closing this issue with the measurements recorded is a perfectly good outcome.
Prior art in this repo
bill_issues/ already does exactly this shape — Gemini structured output scoring bills against the issue taxonomy. Its prompt and schema are a useful reference, and its cost profile is a rough guide.
How issue scoring works today
src/mk_tracking/bigquery_issue_scoring.pyembeds each post, takes the maximum cosine similarity across that issue's 8 hand-curated multilingual anchors, then applies a softmax at temperature0.07across all issues. Anchors live indb/issue_anchors.json.The proposal
Replace that with a single
gemini-flash-litestructured-output call per post, scoring the post against the issue list directly.Measure before implementing
The original issue asserted that this "should improve performance and only slightly increase costs". Neither claim has been tested, and both are load-bearing. Before writing the replacement:
If the numbers do not favour the change, closing this issue with the measurements recorded is a perfectly good outcome.
Prior art in this repo
bill_issues/already does exactly this shape — Gemini structured output scoring bills against the issue taxonomy. Its prompt and schema are a useful reference, and its cost profile is a rough guide.