Upload source code (part 2)
Browse files- web/src/app/results/page.tsx +58 -5
- web/src/components/FilingSearch.tsx +79 -31
- web/src/lib/types.ts +23 -0
web/src/app/results/page.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
-
import { ArrowRight, Columns3, Database, FileSearch, Gauge, Inbox, LineChart, ReceiptText } from "lucide-react";
|
| 2 |
import Link from "next/link";
|
| 3 |
import { BarBreakdown, TrainingCurve } from "@/components/charts";
|
| 4 |
import { Banner, Button, Card, Pill, Stat } from "@/components/ui";
|
| 5 |
import { loadDashboard, loadReceipts } from "@/lib/data";
|
|
|
|
| 6 |
|
| 7 |
const RECEIPT_ROWS = [
|
| 8 |
{ key: "zeroshot", label: "Zero-shot" },
|
|
@@ -20,10 +21,10 @@ const LADDER = [
|
|
| 20 |
];
|
| 21 |
|
| 22 |
const SCREENS = [
|
| 23 |
-
{ href: "/receipts/
|
| 24 |
-
{ href: "/queue/", icon: Inbox, title: "
|
| 25 |
-
{ href: "/search/", icon: FileSearch, title: "Filing search", text: "
|
| 26 |
-
{ href: "/compare/", icon: Columns3, title: "Compare methods", text: "The same question under BM25, dense, routing and reranking, side by side." },
|
| 27 |
];
|
| 28 |
|
| 29 |
export default function Overview() {
|
|
@@ -33,6 +34,7 @@ export default function Overview() {
|
|
| 33 |
const m = d.retrieval.metrics;
|
| 34 |
const flagged = receipts.filter((x) => x.flagged).length;
|
| 35 |
const pg = d.pgvector;
|
|
|
|
| 36 |
|
| 37 |
return (
|
| 38 |
<>
|
|
@@ -147,6 +149,57 @@ export default function Overview() {
|
|
| 147 |
</Card>
|
| 148 |
</div>
|
| 149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
<h2 className="mt-7 mb-3 text-[16px] font-bold text-ink">Explore the results</h2>
|
| 151 |
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
| 152 |
{SCREENS.map(({ href, icon: Icon, title, text }) => (
|
|
|
|
| 1 |
+
import { ArrowRight, Columns3, Database, FileSearch, Gauge, Inbox, LineChart, ReceiptText, Sparkles } from "lucide-react";
|
| 2 |
import Link from "next/link";
|
| 3 |
import { BarBreakdown, TrainingCurve } from "@/components/charts";
|
| 4 |
import { Banner, Button, Card, Pill, Stat } from "@/components/ui";
|
| 5 |
import { loadDashboard, loadReceipts } from "@/lib/data";
|
| 6 |
+
import { ANSWER_MODES } from "@/lib/types";
|
| 7 |
|
| 8 |
const RECEIPT_ROWS = [
|
| 9 |
{ key: "zeroshot", label: "Zero-shot" },
|
|
|
|
| 21 |
];
|
| 22 |
|
| 23 |
const SCREENS = [
|
| 24 |
+
{ href: "/receipts/", icon: ReceiptText, title: "Before vs after", text: "Every test receipt read before and after fine-tuning, against the human label." },
|
| 25 |
+
{ href: "/queue/", icon: Inbox, title: "Receipt inbox", text: "All 100 test receipts: which add up, which need a person, and export to CSV." },
|
| 26 |
+
{ href: "/search/", icon: FileSearch, title: "Filing search", text: "150 analyst questions: SumProof's cited answer and the evidence pages from real SEC filings." },
|
| 27 |
+
{ href: "/compare/", icon: Columns3, title: "Compare search methods", text: "The same question under BM25, dense, routing and reranking, side by side." },
|
| 28 |
];
|
| 29 |
|
| 30 |
export default function Overview() {
|
|
|
|
| 34 |
const m = d.retrieval.metrics;
|
| 35 |
const flagged = receipts.filter((x) => x.flagged).length;
|
| 36 |
const pg = d.pgvector;
|
| 37 |
+
const ans = d.answers;
|
| 38 |
|
| 39 |
return (
|
| 40 |
<>
|
|
|
|
| 149 |
</Card>
|
| 150 |
</div>
|
| 151 |
|
| 152 |
+
{ans && (
|
| 153 |
+
<Card
|
| 154 |
+
className="mt-5"
|
| 155 |
+
title="Answer generation (RAG)"
|
| 156 |
+
icon={<Sparkles size={18} />}
|
| 157 |
+
action={<Pill tone="good">judge agrees with exact rule {(ans.judge_vs_numeric_rule.agreement * 100).toFixed(1)}%</Pill>}
|
| 158 |
+
>
|
| 159 |
+
<div className="relative overflow-x-auto rounded-xl border border-line bg-surface-solid">
|
| 160 |
+
<table className="w-full min-w-[640px] text-[13.5px]">
|
| 161 |
+
<thead>
|
| 162 |
+
<tr className="border-b border-line text-left text-[11.5px] tracking-wide text-muted uppercase">
|
| 163 |
+
<th className="px-3 py-2.5 font-semibold">Context given to Qwen3.5-4B</th>
|
| 164 |
+
<th className="px-3 py-2.5 text-right font-semibold">Correct</th>
|
| 165 |
+
<th className="px-3 py-2.5 text-right font-semibold">Wrong</th>
|
| 166 |
+
<th className="px-3 py-2.5 text-right font-semibold">Refused</th>
|
| 167 |
+
<th className="px-3 py-2.5 text-right font-semibold">Pages</th>
|
| 168 |
+
<th className="px-3 py-2.5 text-right font-semibold">Prompt tokens</th>
|
| 169 |
+
</tr>
|
| 170 |
+
</thead>
|
| 171 |
+
<tbody className="tabular">
|
| 172 |
+
{ANSWER_MODES.map(({ key, label, note }) => {
|
| 173 |
+
const r = ans.modes[key];
|
| 174 |
+
const pct = (v: number) => `${(v * 100).toFixed(1)}%`;
|
| 175 |
+
const main = key === "top5" || key === "adaptive";
|
| 176 |
+
return (
|
| 177 |
+
<tr key={key} className={`border-b border-line last:border-0 ${main ? "font-semibold" : ""}`}>
|
| 178 |
+
<td className="px-3 py-2.5">
|
| 179 |
+
{label} <span className="font-normal text-muted">· {note}</span>
|
| 180 |
+
</td>
|
| 181 |
+
<td className="px-3 py-2.5 text-right">{pct(r.correct)}</td>
|
| 182 |
+
<td className="px-3 py-2.5 text-right">{pct(r.wrong)}</td>
|
| 183 |
+
<td className="px-3 py-2.5 text-right">{pct(r.refused)}</td>
|
| 184 |
+
<td className="px-3 py-2.5 text-right">{r.pages_mean.toFixed(1)}</td>
|
| 185 |
+
<td className="px-3 py-2.5 text-right">{r.prompt_tokens_mean.toLocaleString("en-US")}</td>
|
| 186 |
+
</tr>
|
| 187 |
+
);
|
| 188 |
+
})}
|
| 189 |
+
</tbody>
|
| 190 |
+
</table>
|
| 191 |
+
</div>
|
| 192 |
+
<p className="mt-3 text-[13px] leading-relaxed text-muted">
|
| 193 |
+
RAG raises correct answers from {(ans.modes.closed.correct * 100).toFixed(0)}% to {(ans.modes.top5.correct * 100).toFixed(0)}%. Keeping
|
| 194 |
+
pages until they hold 90% of the reranker's confidence uses{" "}
|
| 195 |
+
{((1 - ans.modes.adaptive.prompt_tokens_mean / ans.modes.top5.prompt_tokens_mean) * 100).toFixed(0)}% fewer tokens with no
|
| 196 |
+
significant accuracy change (McNemar p = 0.48). Even with the analysts' own pages a 4B model reaches{" "}
|
| 197 |
+
{(ans.modes.oracle.correct * 100).toFixed(0)}%, so the next gain is in reasoning, not retrieval. For scale, the FinanceBench paper
|
| 198 |
+
reports GPT-4-Turbo with retrieval failing 81% of these 150 questions.
|
| 199 |
+
</p>
|
| 200 |
+
</Card>
|
| 201 |
+
)}
|
| 202 |
+
|
| 203 |
<h2 className="mt-7 mb-3 text-[16px] font-bold text-ink">Explore the results</h2>
|
| 204 |
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
| 205 |
{SCREENS.map(({ href, icon: Icon, title, text }) => (
|
web/src/components/FilingSearch.tsx
CHANGED
|
@@ -1,12 +1,42 @@
|
|
| 1 |
"use client";
|
| 2 |
|
| 3 |
-
import {
|
| 4 |
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
| 5 |
import { useEffect, useMemo, useState } from "react";
|
| 6 |
-
import { prettyDoc, TYPE_LABEL, type QuestionSummary } from "@/lib/types";
|
| 7 |
import { Highlight, keyTerms, QuestionPicker, snippet, useQuestion } from "./QuestionPicker";
|
| 8 |
import { Banner, Card, Pill } from "./ui";
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
| 11 |
const params = useSearchParams();
|
| 12 |
const router = useRouter();
|
|
@@ -25,9 +55,11 @@ export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
|
| 25 |
};
|
| 26 |
|
| 27 |
const hits = useMemo(() => detail?.methods.reranked.slice(0, 5) ?? [], [detail]);
|
|
|
|
|
|
|
| 28 |
useEffect(() => {
|
| 29 |
-
if (detail && selected === null && hits.length) setSelected(hits[0].row);
|
| 30 |
-
}, [detail, selected, hits]);
|
| 31 |
|
| 32 |
const terms = detail ? keyTerms(detail.question) : [];
|
| 33 |
const page = detail && selected !== null ? detail.pages[String(selected)] : null;
|
|
@@ -46,7 +78,7 @@ export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
|
| 46 |
<Pill>150 analyst questions</Pill>
|
| 47 |
</>
|
| 48 |
}
|
| 49 |
-
meta="Pick an analyst question about a company's SEC filing. SumProof finds the pages that answer it
|
| 50 |
>
|
| 51 |
<QuestionPicker questions={questions} value={qi} onChange={choose} />
|
| 52 |
</Banner>
|
|
@@ -56,34 +88,49 @@ export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
|
| 56 |
|
| 57 |
{detail && (
|
| 58 |
<>
|
| 59 |
-
<Card className="mb-5" title="
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
<>
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
</div>
|
| 81 |
-
|
|
|
|
| 82 |
<button
|
| 83 |
type="button"
|
| 84 |
onClick={() => setShowAnswer((s) => !s)}
|
| 85 |
aria-expanded={showAnswer}
|
| 86 |
-
className="flex items-center gap-2 text-[13.5px] font-
|
| 87 |
>
|
| 88 |
<MessageSquareQuote size={16} /> {showAnswer ? "Hide" : "Show"} the analysts' reference answer
|
| 89 |
</button>
|
|
@@ -91,12 +138,13 @@ export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
|
| 91 |
<div className="mt-2 text-[13.5px] leading-relaxed text-ink">
|
| 92 |
<p className="font-semibold">{detail.answer}</p>
|
| 93 |
{detail.justification && <p className="mt-1 text-muted">{detail.justification}</p>}
|
| 94 |
-
<p className="mt-2 text-[12px] text-muted">
|
| 95 |
-
From FinanceBench. SumProof retrieves the evidence pages; writing the answer is the next step (generation).
|
| 96 |
-
</p>
|
| 97 |
</div>
|
| 98 |
)}
|
| 99 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
</Card>
|
| 101 |
|
| 102 |
<div className="grid grid-cols-1 gap-5 xl:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]">
|
|
|
|
| 1 |
"use client";
|
| 2 |
|
| 3 |
+
import { Check, CircleAlert, ExternalLink, FileText, Files, MessageSquareQuote, SearchX, Sparkles } from "lucide-react";
|
| 4 |
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
| 5 |
import { useEffect, useMemo, useState } from "react";
|
| 6 |
+
import { prettyDoc, TYPE_LABEL, type GeneratedAnswer, type QuestionSummary } from "@/lib/types";
|
| 7 |
import { Highlight, keyTerms, QuestionPicker, snippet, useQuestion } from "./QuestionPicker";
|
| 8 |
import { Banner, Card, Pill } from "./ui";
|
| 9 |
|
| 10 |
+
/** The answer without its "Source: [n]" line or inline [n] markers (the sources are shown as chips). */
|
| 11 |
+
function answerBody(text: string): string {
|
| 12 |
+
return text
|
| 13 |
+
.replace(/\n?\s*sources?\s*:[\s\S]*$/i, "")
|
| 14 |
+
.replace(/\s*\[\d{1,2}\]/g, "")
|
| 15 |
+
.trim();
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
function OutcomePill({ g }: { g: GeneratedAnswer }) {
|
| 19 |
+
if (g.outcome === "correct")
|
| 20 |
+
return (
|
| 21 |
+
<Pill tone="good">
|
| 22 |
+
<Check size={13} /> Matches the analysts' answer
|
| 23 |
+
</Pill>
|
| 24 |
+
);
|
| 25 |
+
if (g.outcome === "wrong")
|
| 26 |
+
return (
|
| 27 |
+
<Pill tone="warn">
|
| 28 |
+
<CircleAlert size={13} /> Differs from the analysts' answer
|
| 29 |
+
</Pill>
|
| 30 |
+
);
|
| 31 |
+
if (g.outcome === "refused")
|
| 32 |
+
return (
|
| 33 |
+
<Pill>
|
| 34 |
+
<SearchX size={13} /> Not found in the pages
|
| 35 |
+
</Pill>
|
| 36 |
+
);
|
| 37 |
+
return null;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
export function FilingSearch({ questions }: { questions: QuestionSummary[] }) {
|
| 41 |
const params = useSearchParams();
|
| 42 |
const router = useRouter();
|
|
|
|
| 55 |
};
|
| 56 |
|
| 57 |
const hits = useMemo(() => detail?.methods.reranked.slice(0, 5) ?? [], [detail]);
|
| 58 |
+
const gen = detail?.generated.top5;
|
| 59 |
+
// Open the page the answer cites; otherwise the top-ranked page.
|
| 60 |
useEffect(() => {
|
| 61 |
+
if (detail && selected === null && hits.length) setSelected(gen?.cited.find((r) => detail.pages[String(r)]) ?? hits[0].row);
|
| 62 |
+
}, [detail, selected, hits, gen]);
|
| 63 |
|
| 64 |
const terms = detail ? keyTerms(detail.question) : [];
|
| 65 |
const page = detail && selected !== null ? detail.pages[String(selected)] : null;
|
|
|
|
| 78 |
<Pill>150 analyst questions</Pill>
|
| 79 |
</>
|
| 80 |
}
|
| 81 |
+
meta="Pick an analyst question about a company's SEC filing. SumProof finds the pages that answer it, writes the answer, and shows the page it used."
|
| 82 |
>
|
| 83 |
<QuestionPicker questions={questions} value={qi} onChange={choose} />
|
| 84 |
</Banner>
|
|
|
|
| 88 |
|
| 89 |
{detail && (
|
| 90 |
<>
|
| 91 |
+
<Card className="mb-5" title="SumProof's answer" icon={<Sparkles size={18} />} action={gen ? <OutcomePill g={gen} /> : null}>
|
| 92 |
+
{gen ? (
|
| 93 |
+
<>
|
| 94 |
+
<p className="text-[15px] leading-relaxed whitespace-pre-line text-ink">
|
| 95 |
+
{gen.outcome === "refused" ? "The retrieved pages do not contain the answer." : answerBody(gen.text)}
|
| 96 |
+
</p>
|
| 97 |
+
{gen.cited.length > 0 && (
|
| 98 |
+
<div className="mt-3 flex flex-wrap items-center gap-2 text-[13px] text-muted">
|
| 99 |
+
Source:
|
| 100 |
+
{gen.cited.map((row) => {
|
| 101 |
+
const p = detail.pages[String(row)];
|
| 102 |
+
return p ? (
|
| 103 |
+
<button
|
| 104 |
+
key={row}
|
| 105 |
+
type="button"
|
| 106 |
+
onClick={() => setSelected(row)}
|
| 107 |
+
className="flex items-center gap-1.5 rounded-full border border-line bg-surface-solid px-3 py-1 text-[12.5px] font-medium text-accent hover:border-accent"
|
| 108 |
+
>
|
| 109 |
+
<FileText size={13} /> {prettyDoc(p.doc)}, page {p.page + 1}
|
| 110 |
+
</button>
|
| 111 |
+
) : null;
|
| 112 |
+
})}
|
| 113 |
+
</div>
|
| 114 |
+
)}
|
| 115 |
+
</>
|
| 116 |
+
) : (
|
| 117 |
+
<p className="text-[13.5px] text-muted">No generated answer for this question.</p>
|
| 118 |
+
)}
|
| 119 |
+
|
| 120 |
+
<div className="mt-4 flex flex-wrap items-center gap-2 border-t border-line pt-3 text-[12.5px] text-muted">
|
| 121 |
+
<Files size={14} />
|
| 122 |
+
{detail.detected ? <>Searched {detail.detected.filings.map(prettyDoc).join(", ")}</> : <>No company named, so all 84 filings were searched</>}
|
| 123 |
+
<span className="ml-auto">
|
| 124 |
+
<Pill>{TYPE_LABEL[detail.type] ?? detail.type}</Pill>
|
| 125 |
+
</span>
|
| 126 |
</div>
|
| 127 |
+
|
| 128 |
+
<div className="mt-3 rounded-xl border border-line bg-sunken p-3.5">
|
| 129 |
<button
|
| 130 |
type="button"
|
| 131 |
onClick={() => setShowAnswer((s) => !s)}
|
| 132 |
aria-expanded={showAnswer}
|
| 133 |
+
className="flex items-center gap-2 text-[13.5px] font-medium text-accent"
|
| 134 |
>
|
| 135 |
<MessageSquareQuote size={16} /> {showAnswer ? "Hide" : "Show"} the analysts' reference answer
|
| 136 |
</button>
|
|
|
|
| 138 |
<div className="mt-2 text-[13.5px] leading-relaxed text-ink">
|
| 139 |
<p className="font-semibold">{detail.answer}</p>
|
| 140 |
{detail.justification && <p className="mt-1 text-muted">{detail.justification}</p>}
|
|
|
|
|
|
|
|
|
|
| 141 |
</div>
|
| 142 |
)}
|
| 143 |
</div>
|
| 144 |
+
<p className="mt-3 text-[12px] text-muted">
|
| 145 |
+
Written by Qwen3.5-4B from the 5 best pages below. AI can misread tables and calculations, so check the source page before
|
| 146 |
+
relying on a number.
|
| 147 |
+
</p>
|
| 148 |
</Card>
|
| 149 |
|
| 150 |
<div className="grid grid-cols-1 gap-5 xl:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]">
|
web/src/lib/types.ts
CHANGED
|
@@ -30,8 +30,22 @@ export type QuestionSummary = {
|
|
| 30 |
company: string;
|
| 31 |
type: string;
|
| 32 |
rank: Record<Method, number | null>; // first rank of an evidence page in the top 10, or null
|
|
|
|
| 33 |
};
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
export type Hit = { row: number; gold: boolean; score?: number };
|
| 36 |
|
| 37 |
export type QuestionDetail = {
|
|
@@ -45,6 +59,7 @@ export type QuestionDetail = {
|
|
| 45 |
gold: { row: number; doc: string; page: number }[];
|
| 46 |
detected: { company: string; years: number[]; filings: string[] } | null;
|
| 47 |
methods: Record<Method, Hit[]>;
|
|
|
|
| 48 |
pages: Record<string, { doc: string; page: number; text: string }>;
|
| 49 |
};
|
| 50 |
|
|
@@ -64,6 +79,14 @@ export type Dashboard = {
|
|
| 64 |
faiss: { benchmark: { index: string; efSearch: number | null; ms_per_query: number; "overlap@10_vs_exact": number; "recall@5_gold": number }[] };
|
| 65 |
pgvector: Record<string, string | number>;
|
| 66 |
train_log: { step: number; epoch: number; loss: number; lr: number }[];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
val_log: { field_f1: number; total_accuracy: number; epoch: number }[];
|
| 68 |
};
|
| 69 |
|
|
|
|
| 30 |
company: string;
|
| 31 |
type: string;
|
| 32 |
rank: Record<Method, number | null>; // first rank of an evidence page in the top 10, or null
|
| 33 |
+
outcome?: Partial<Record<AnswerMode, Outcome>>;
|
| 34 |
};
|
| 35 |
|
| 36 |
+
/** How the generated answer compares with the analysts' reference answer. */
|
| 37 |
+
export type Outcome = "correct" | "wrong" | "refused" | "ungraded";
|
| 38 |
+
export type AnswerMode = "closed" | "top5" | "adaptive" | "oracle";
|
| 39 |
+
|
| 40 |
+
export type GeneratedAnswer = { text: string; rows: number[]; cited: number[]; outcome: Outcome; prompt_tokens: number };
|
| 41 |
+
|
| 42 |
+
export const ANSWER_MODES: { key: AnswerMode; label: string; note: string }[] = [
|
| 43 |
+
{ key: "closed", label: "No pages (closed book)", note: "what the model knows" },
|
| 44 |
+
{ key: "top5", label: "Top 5 reranked pages", note: "standard RAG" },
|
| 45 |
+
{ key: "adaptive", label: "Confidence-gated pages", note: "1 to 5 pages" },
|
| 46 |
+
{ key: "oracle", label: "The analysts' evidence pages", note: "ceiling" },
|
| 47 |
+
];
|
| 48 |
+
|
| 49 |
export type Hit = { row: number; gold: boolean; score?: number };
|
| 50 |
|
| 51 |
export type QuestionDetail = {
|
|
|
|
| 59 |
gold: { row: number; doc: string; page: number }[];
|
| 60 |
detected: { company: string; years: number[]; filings: string[] } | null;
|
| 61 |
methods: Record<Method, Hit[]>;
|
| 62 |
+
generated: Partial<Record<AnswerMode, GeneratedAnswer>>;
|
| 63 |
pages: Record<string, { doc: string; page: number; text: string }>;
|
| 64 |
};
|
| 65 |
|
|
|
|
| 79 |
faiss: { benchmark: { index: string; efSearch: number | null; ms_per_query: number; "overlap@10_vs_exact": number; "recall@5_gold": number }[] };
|
| 80 |
pgvector: Record<string, string | number>;
|
| 81 |
train_log: { step: number; epoch: number; loss: number; lr: number }[];
|
| 82 |
+
answers?: {
|
| 83 |
+
judge: string;
|
| 84 |
+
modes: Record<
|
| 85 |
+
AnswerMode,
|
| 86 |
+
{ correct: number; wrong: number; refused: number; pages_mean: number; prompt_tokens_mean: number; context_has_evidence_page: number | null }
|
| 87 |
+
>;
|
| 88 |
+
judge_vs_numeric_rule: { answers: number; agreement: number };
|
| 89 |
+
};
|
| 90 |
val_log: { field_f1: number; total_accuracy: number; epoch: number }[];
|
| 91 |
};
|
| 92 |
|