feat(parse): warn when the answer looks one link away - #1148
Open
Ebenezer-03 wants to merge 1 commit into
Open
Conversation
A single-page graph answers only about the text it was handed. When the evidence lives on a page this one links to, a privacy policy or a terms or team page, the model does not stay silent: asked whether a fact holds, it returns a confident negative that reads exactly like a genuine "this is not true of this site". Nothing in the run says the answer was never fetched. ParseNode now warns when a term the user asked about is absent from the page's own prose but present in the label or target of a link, and points at DepthSearchGraph. The check is deterministic and LLM-free, following the existing check for content that holds no trace of the request. Requiring the term to be missing from the prose keeps it quiet whenever the page can answer, and the two warnings do not stack. Fixes ScrapeGraphAI#1120
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 #1120.
SmartScraperGraphreads one page. When the evidence for the prompt lives on a page that one links to, a privacy policy or terms or an "our team" page, the model doesn't say it can't tell. Asked whether a fact holds, it returns a confident negative that looks exactly like a real "this is not true of this site". Nothing in the run says the answer was never fetched.The issue reports it on two live sites where the notice is real but sits one link away, and both come back
no_transfer_notice: False. For compliance questions that error has a direction: a false "no restriction found" is the answer someone acts on.What this adds
ParseNodenow warns when a term the user asked about is missing from the page's own prose but shows up in the label or target of a link:This is suggestion (2) from the issue. It's deterministic and LLM-free, and follows the check already in this file for content that holds no trace of the request (#1136), reusing its
_collect_expected_terms.Keeping it quiet
A hint that fires on every page with a footer link would be worse than no hint. Two things hold it back:
_warn_if_content_lacks_requested_fieldsnow returns whether it fired, and the link hint only runs when it didn't. A page with no trace of the request gets one warning, not two.Tests
Five, in
tests/test_error_page_detection.pynext to the existing ParseNode ones:/privacy/Checks
uv run pyteston the same suite as.github/workflows/test-suite.yml: 100 passed, up from 95 onpre/beta.ruff check,black --checkandisort --check-onlyall clean on both files I touched.Two tests fail on
pre/betabefore this branch,test_llm_missing_tokensandtest_script_creator_multi_graph.py::test_entry_point_node. I checked them on a clean checkout, didn't touch either, and neither runs in CI.No dependency changes,
uv.lockuntouched.Not in this PR
Suggestion (1), a separate "not found on this page" state, changes the returned shape and is worth its own discussion. Suggestion (3), docs, would mean editing the README plus nine translations, so I kept this to one logical change. Happy to do either as a follow-up.