Repository navigation
Scripts and data for the illustrative examples and benchmarks. - #224
Merged
Merged
Conversation
Develop to Main
reference_example.py builds check, planted and suggestion projects from the committed article corpus, asks reference_check and suggest_reference at temperature 0 with every claim checked, and scores reference matching, citation detection, planted-miscitation verdicts and suggestion ranks against reference_annotations.json. The suggestion project leaves out the article, so it cannot suggest itself.
The article, its planted copy and the cited works share one project for both reference checks; the cited works alone form the suggestion project, since suggest_reference cannot be told to leave out the article and its copy.
make_planted.py reads the article as KíLín reads the PDF, changes eight citation numbers (six to unrelated works, two to related ones), writes tiunn26braph2_planted.txt and records the changes in reference_annotations.json. A text copy keeps the sentences as KíLín reads them; editing the PDF split the edited lines into separate blocks.
prepare_code_project now sets temperature 0 and the download policy through configure_project instead of editing profile.ini, so the code example, its no-retrieval baseline and paper_numbers all generate deterministically. Both scripts record the temperature in their results.
Both examples now generate as a new project in the app does: the code example at the code type's temperature and the reference example at the literature type's. The scripts write that value into their sandbox workspaces and record it in the results. The reference example no longer overrides the temperature per question.
Add the callers that appeared since October (_answer_sentences, RAGSession._source_passages, reference_check's _choose_list and _second_look), narrow strip_thinking_callers to answering.py since strip_thinking now has 19 callers, and correct facts where the code changed. The evaluation questions keep their wording.
code_example.py, paper_numbers.py and reference_example.py take --router-model and save it in their sandbox projects, as choosing the intent model in the app's project settings does. Without the option the packaged default is saved. The results record the router model used.
Fifteen sentences in four groups: tools, uses and results (one work states each) and background (several works support each, all listed as acceptable). Papers with the same verdict and score now share a rank and are reported as a tie, and the summary counts each group separately.
Nine questions now start with "Explain", and four name the function they ask about. Each question marks its core facts (core_facts), which the grading worksheet labels.
All 45 questions now start with "Explain" and ask about the code. The development and evaluation sets are dropped, since the questions are examples rather than a held-out benchmark. A passage of a class whose lines contain a whole gold method now counts for that method.
Since startup events moved to logs/traces/project.json, paper_numbers recorded an empty operations_s. It now also reads the events of the session it just opened from the project trace, and includes reading, extracting and chunking the sources.
evaluate_retrieval returns a bootstrap interval of NDCG@10 over the queries, and the code-question notebooks record Wilson intervals for their counts and a bootstrap interval for the mean citation coverage. The bootstrap uses a fixed seed so that a run gives the same interval.
The code-question gold set was annotated on a previous source; since then several functions moved, so the locations pointed at unrelated lines. Every location now matches commit 6cb105d; A3 also cites the code project type's system prompt, which a code project uses.
Rounding could give an upper bound of 0.9999999999999999 for 42 of 42, which failed the test on CI. The bound is exactly 1 (or 0) in these cases, so set it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference example (
reference_analysis/)reference_example.pybuilds two literature projects (with and without the article), runsreference_checkon the article and on a copy with eight planted miscitations, and askssuggest_referencefor 15 statements; it recomputes the rule-based counts and writes JSON results with a grading worksheet.make_planted.pywrites the planted copy;reference_annotations.jsonholds the statements (grouped as tools, uses, results, background) and the planted changes.literature_repo/papers.Code example (
code_analysis/)--questionsselects questions by identifier (replaces--sets).Timing (
paper_numbers.py)logs/traces/project.json, where startup events are recorded since the project trace was introduced (operations_swas empty); also reports reading, extracting and chunking the sources.Benchmarks (
benchmarks/)evaluate_retrievalreturns a 95% bootstrap interval of NDCG@10 over the queries (ndcg_interval).