Repository navigation
Fix Unicode keyword matching and keep ANN widening on the paper shortlist - #38
Merged
Merged
Conversation
…ortlist Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
…zers Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
…al databases Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
…e boundaries Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
…r digits Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
…ules Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
Signed-off-by: Bill Hlavacek <hlavacek@lanl.gov>
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.
Retrieval changes
Keyword front-loading now uses the same Unicode normalization for query terms, stored chunks and paper titles. Queries match ligatures, compatibility digits and case variants in existing databases. When a raised number could be either an isotope label or a table note, the search checks the shortlisted papers for the numbered acronym first and uses the bare acronym if that spelling is absent. Applications executing
sqlite_norm_expr()directly on a raw SQLite connection can register the normalizer once withlitkit.retrieval.register_search_normalizer(conn).Widened FAISS searches now apply the Stage‑1 paper filter on every round and stop when every shortlisted paper reaches its cap. Duplicate chunk IDs count once. A sparse shortlist can still trigger the reported global fallback. An explicitly global lexical search can supply keyword matches from other papers while ANN widening stays constrained. Repeated paper IDs no longer make the shortlist appear sparse, and the CLI honors its documented
LITKIT_ALLOW_GLOBAL_LEXICAL=1setting.Closes #20
Closes #25
Verification
8e78224through80a25dbreturned clean. The final round also exercised a read-only existing SQLite database and a real FAISS index with duplicate hits.*_pending.npzsegments #4, Builds give a paper a second vector when it reappears #7 and Databases created before doc_id can't be opened #10.BRCA1突变, scientific terms adjacent to table notes, isotope-specific results under a one-hit limit, SQLite locks and authorizers, and a capped one-paper shortlist where a single FAISS search is sufficient.fibrosis-associatedandCD4returned two chunks from the one shortlisted paper, respecting the two-chunk cap.SQLite timings
Measured the same three-term query (
fibrosis-associated,rna,cd4) with a 200-result limit on Python 3.12.12 and SQLite 3.50.4. The benchmark used a temporary tenfold copy of a 297-paper, 11,670-chunk corpus. Times are medians of three warm runs after one warm-up.