Skip to content

Claude/eager napier - #1

Open
lszoszk wants to merge 4 commits into
mainfrom
claude/eager-napier
Open

lszoszk wants to merge 4 commits into
mainfrom
claude/eager-napier

Conversation

@lszoszk

@lszoszk lszoszk commented Apr 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

lszoszk and others added 4 commits April 13, 2026 08:41
Press releases are a distinct document type and should not be counted
alongside judgments. Before this fix, build_pages_dashboard.py processed
every record in the JSONL regardless of document_type, causing press releases
to inflate total_cases, violation rates, country rankings, article breakdowns,
chamber counts, outcome distributions, and every other metric that is meant to
describe judicial outcomes only.

Changes:
- Add is_press_release() helper (mirrors search-app.js logic: document_type
  contains "press release", case-insensitive).
- Skip press releases at the top of the build_payload() loop so they do not
  touch any judgment counter.
- Track press release count separately; expose it as summary.total_press_releases
  so the KPI card in index.html can still display it.
- total_cases now reflects judgments only; input_record_count preserves the
  original total (judgments + press releases) for data-provenance purposes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rebuilt from full dataset (18,429 records): 13,480 judgments,
4,949 press releases excluded. Violation rate now 77.8% on
judgments only; total_press_releases added to summary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add docs/about.html with authors (Łukasz Szoszkiewicz, Sebastian
  Marcisz), data sources table with direct link to ECTHR-PCR dataset
  on HuggingFace, dataset field reference, methodology, and
  acknowledgements.
- Add scripts/merge_ecthr_pcr.py to enrich the ECHR JSONL with
  structured citation-network data from RashidHaddad/ECTHR-PCR
  (15,729 cases, joined on appno). Adds pcr_citations, pcr_cited_by,
  pcr_citation_count, pcr_cited_by_count fields. Original dataset
  is left untouched; output goes to a new file.
- Add "About" nav link to index.html and analytics.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lszoszk added a commit that referenced this pull request May 11, 2026
Searching for a case name (e.g. "KRASNOSHAPKA") returned 38 cases that
cite the source case before the actual KRASNOSHAPKA v UKRAINE judgment
itself.  Cause: SQLite FTS5 BM25's field-length normalisation lets
repeated body matches from Pop C committee cases (each citing the case
once) outscore the short-title source case even with title weight 5.0.
The existing comment in main.py already noted the same pathology on
"Hirst" — max*ln dampens it but isn't enough for proper-name queries.

Fix:
- `ranking.title_matches_query(title, query_terms)` — case-insensitive
  whole-word check, ignores stopwords and tokens shorter than 4 chars
  ("L.P." case-name searches stay unboosted because both letters are
  too short to anchor on).
- `ranking.TITLE_MATCH_BOOST = 3.0` multiplicative boost applied in
  `compute_final_score` when any query term hits the case title.
- Search SQL now selects `c.title` in the per-case aggregate so the
  rerank pass can tag each candidate with `title_match=True/False`.

Verified on VM (post `docker compose build`):

  Query           Before                            After
  ─────────       ──────────────────────────────    ──────────────────────────────
  KRASNOSHAPKA    KRASNOSHAPKA v UKRAINE @ #39      KRASNOSHAPKA v UKRAINE @ #1  (38.7)
  Hirst           HIRST v UK (No. 2) @ #1 already   HIRST v UK (No. 2) @ #1      (60.1)
  Mirzoyan        MIRZOYAN v ARMENIA @ #1 already   MIRZOYAN v ARMENIA @ #1      (41.4)
  Grzęda          GRZĘDA v POLAND @ #1              GRZĘDA v POLAND @ #1         (68.8)
  torture         no title-match cases, unchanged   no regression (substantive on top)
  margin of …     no title-match cases, unchanged   no regression

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
lszoszk added a commit that referenced this pull request May 17, 2026
…n metrics

#1 — HUDOC fidelity. The Case Note context window now groups consecutive
physical rows that share a logical paragraph (a numbered ¶ plus its
indented quote / continuation rows) into one block: the "¶ N" number
shows once, with quote rows rendered as an indented sub-block — the way
HUDOC presents a paragraph with a quotation inside it. Previously a
paragraph that quoted e.g. Article 8 rendered as three separate "¶ 74"
rows, which read as a numbering error. getCaseNoteContext now windows
in logical paragraphs; "show earlier/later" steps by logical ¶.

#3 — trust. The citation graph (P29) has partial coverage, so a 0 is
ambiguous ("uncited" vs "no data"). The INFLUENCE bars (cites / cited
by) and the Case Note "Citations" field now render 0 as a dimmed "—"
with an explanatory tooltip, instead of asserting a misleading zero on
landmark cases. The hit count stays a real number.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant