Repository navigation
Conversation
`AsyncUrlSeeder._parse_head()` returns `{"title": ..., "meta": {...}, ...}`,
but `_calculate_relevance()` looked the page title up under
`head_data["meta"]["title"]` and `_calculate_novelty()` looked the description
and keywords up under `head_data["description"]` / `["keywords"]`.
None of those three keys exist, so the term extraction always ignored the
`<head>` data: a link whose only match was its page title scored 0 relevance
and was never followed, and a link whose only new terms lived in the meta
description was reported as having unknown novelty.
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.
What
StatisticalStrategylooked the<head>data of a discovered link up under keys thatAsyncUrlSeeder._parse_head()never returns, so the title, meta description and meta keywords of every link were silently ignored.Why
_parse_head()returns{"title": ..., "meta": {"description": ..., "keywords": ...}, ...}(that is how_extract_text_context()reads it too). But the ranking helpers used:link.head_data["meta"]["title"]in_calculate_relevance()link.head_data["description"]andlink.head_data["keywords"]in_calculate_novelty()Neither
meta.titlenor the two top-level keys exist, so all three lookups always produced''.User-visible effect: a link whose only match with the query was its page title scored
0relevance and was never followed, and a link whose only new terms were in its meta description was reported with the "unknown novelty" fallback (its terms were never counted as already seen).How checked
Added
tests/test_adaptive_link_head_data_keys.py, which builds thehead_datawith the real_parse_head()and asserts that the title contributes to relevance and that the description/keywords contribute to novelty.main: 2 failed