Reduce structural noise before graph extraction for mixed-source narrative inputs#583
Open
YeJe-cpu wants to merge 1 commit into
Open
Reduce structural noise before graph extraction for mixed-source narrative inputs#583YeJe-cpu wants to merge 1 commit into
YeJe-cpu wants to merge 1 commit into
Conversation
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.
PR Title
Reduce structural noise before graph extraction for mixed-source narrative inputs
PR Body
Summary
This PR adds a small preprocessing step before Step 1 graph extraction to reduce structural noise in markdown-like mixed-source narrative inputs.
The goal is not to solve canonicalization or post-build deduplication. The goal is earlier: prevent obvious non-entity text from entering the graph in the first place.
Why this change
While testing MiroFish on real narrative packets based on Breaking Bad counterfactual simulations, I found that Step 1 could promote structural text into entities.
These packets were not plain prose. They included a mix of:
One packet explored a scenario where Gus Fring survives. Another explored a scenario where Walter White never enters the drug trade.
Under this kind of mixed-source input, Step 1 could promote structural text into entities, including:
I focused on preprocessing because the dominant failure mode I observed was structural text entering the graph before later-stage deduplication could help.
What this patch does
preprocess_text()before chunkingS04E13Validation
I validated this on two real mixed-source narrative packets based on Breaking Bad counterfactual simulations.
Case A
This packet explored a “Gus survives” scenario and included multiple documents with episode titles, episode identifiers, naming conventions, and extraction notes.
56nodes /156edges29nodes /38edgesExamples of nodes that no longer entered the graph:
Face OffBox CutterHalf MeasuresFull MeasureCrawl SpaceEnd TimesMiroFishKey entities still preserved:
Walter WhiteHeisenbergJesse PinkmanGusGus FringMike EhrmantrautSaul GoodmanCase B
This packet explored a “Walter White never enters the drug trade” scenario using earlier-season material with lighter structural noise.
24nodes /27edges23nodes /32edgesThe effect is smaller here, but it suggests the preprocessing is not only reacting to one single packet.
What this PR does not do
This PR does not attempt to solve:
GusvsGus Fring,Walter WhitevsHeisenberg)It only reduces one upstream source of noisy entities.
Notes
If useful, I can also share the exact validation inputs I used for reproduction.