Repository navigation
fix(rank): match whole words, fold plurals, drop query stopwords - #47
Merged
Merged
Conversation
The evaluation (#35) found two ranking defects. Both are fixed here, and the soft probes that recorded them are now hard checks: - Query terms matched as substrings, so "run" matched "Test runner" and "test" matched "latest", and a memory that merely contained the letters could outrank the one that answered. - There was no stopword list, so "what is the for" matched every memory containing "the" or "for". Fields and queries are now split into words (any script, not just ASCII), lowercased, and folded from plural to singular by rule ("tests" → "test", "policies" → "policy"); terms match whole words. A short English stopword list is dropped from the query — negations stay, since they change meaning. A query of nothing but stopwords has no terms and, being non-empty, returns nothing rather than the whole context. Evaluation, before → after: minimisation precision 29% → 67%, overall precision 74% → 82%, MRR 0.97 → 1.00; all 29 checks pass, no known gaps. Bumps the plugin to 0.6.1. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
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.
Fixes the two ranking defects the evaluation harness (#46) found, and makes their probes hard checks.
Changes
Evaluation, before → after
minimisation-stopwordsandprecision-word-boundariesare now hard. One adjustment to the latter: its "runner" memory's description no longer contains the word "run" itself, because with whole-word matching that memory legitimately matches both query words and the probe was testing two things at once. As adjusted, the probe fails under the old substring ranking (the name "runner" scored) and passes under this one.Unit tests cover word boundaries, plural folding both ways, non-plural
-swords, stopword-only queries, and non-Latin words.Plugin and crate → 0.6.1.