Repository navigation
Fix/nearest qualifier clean - #113
Conversation
Dominik-Galus
left a comment
There was a problem hiding this comment.
- A group heading above a category becomes one of its items, with the edge reversed (must fix). _resolve_topic_ends ignores edge direction. I gave it real page 4 text with the heading written as a Topic:
MERGE (g:Topic {title: 'W grupie pracownikow badawczych'}) -> (g:Criterion …)
MERGE (g)-[:HAS_CRITERION]->(cc) -> (g)<-[:HAS_CRITERION]-(cc)
"Dorobek naukowy" now "has criterion" W grupie pracowników badawczych: the hierarchy is inverted. That group → category link is exactly what the fused "Działalność dydaktyczna" (11 = 6 + 8) needs to be preserved. Fix: infer a Topic's label only when the direction agrees:
- Topic as the source of an edge to an item → it's a category.
- Topic as the target of an edge from a category → it's an item.
- Otherwise leave it alone.
-
A qualifier word anywhere in prose flips criterion edges (must fix). The "nearest qualifier above" rule reads any wymagan*, niezbedn* or pozadan* token on the page. The OTM-R policy PDF has these words in prose on 7 pages ("wymagania", "niezbędne dokumenty"). A probe on p15 with a CriterionCategory → Criterion edge:
MERGE (cc)-[:HAS_CRITERION]->(c) -> MERGE (cc)-[:REQUIRES]->(c)
On top of that, page_relationship_type gives every item whose title isn't found on the page the page's single qualifier type. Fix: count only qualifiers on a heading line (short, ending in :), placed between the category's title and the item. -
Pair edges of an uncontrolled type get a second edge instead of a rewrite (should fix). Only HAS_CRITERION, REQUIRES, RECOMMENDS and RELATED_TO count as "linked". In PR run 1 on p1 the model wrote HAS_SUBCOMPETENCY ×25. Those items counted as unlinked, and the log shows Rewrote 25 … added MERGE (node5)-[:REQUIRES]->(node6)…. The graph ends up with both edges per item, and the run's signature differs from runs 2–3. Fix: decide "controlled" by the label pair, not by a list of types.
Could you re-run your three runs on p1 and p4? |
There was a problem hiding this comment.
Unrelated deletions:
- the module docstring of tests/data_pipeline/test_completeness.py (the #53 / #78 history), plus ~12 per-test docstrings
- the module docstring of tests/test_llm_determinism_config.py (the #52 rationale)
- Polish test strings translated to English ("Pierwszy punkt regulaminu" -> "First policy point")
- is_code_token moved to text_normalization with its docstring cut to one line, losing the #106 reasoning
On that graph R2's items are Criterion under a CompetencyCategory. Neither configured pair (CompetencyCategory<->Competency, CriterionCategory<->Criterion) matches that, so the pass leaves it unchanged; a probe confirms it.
…dges deterministically
c73144f to
9f46bf9
Compare
Refs #104
Relationship types are now a closed set. Aliases map known variants to the canonical type, and anything unknown becomes RELATED_TO, logged as a warning.
Category → item edges get one direction and one type. The type comes from the qualifier on the page nearest above the item (pożądane → RECOMMENDS, wymagane/niezbędne → REQUIRES), so pages that list both kinds work too.
A Topic end takes the label from its pair, and an unattached item is linked to the nearest category above it.
A reproducibility test and a benchmark script compare graph shape across runs.
Pending (needs an API key): running the script on the R1–R4 page and checking the R2 questions on a rebuilt graph. Deploying requires one full re-ingest.