Skip to main content

Relationship Inference Strategies

The knowledge graph extraction pipeline uses deterministic, rule-based (regular-expression) strategies rather than LLM-based relation extraction. This design choice prioritises reproducibility, auditability, and speed: the same page content always produces the same extraction result, each relationship can be traced to a specific strategy, and extraction completes in milliseconds without API calls.

Why Rules Over an LLM?​

CriterionRule-based strategiesLLM relation extraction
DeterminismIdentical output for identical inputNon-deterministic
AuditabilityEach relationship tagged with strategy and confidenceBlack-box output
CostNo marginal cost per pageAn API call per page
LatencyMilliseconds per pageSeconds per page
CoverageLimited to known patternsCan discover novel relationships

The system compensates for the limited coverage of rules through domain knowledge maps (Strategy 2) and plausibility guards that filter implausible relationships rather than trying to discover all possible ones.

Strategy Catalog​

All strategies live in one extraction step. They run sequentially on every page, each contributing relationships that pass through a shared plausibility filter.

Pre-conditions​

Before any strategy runs, the page-level context is computed:

  • Page department. Inferred from the page address or title.
  • Doctor page. True if the page has two or fewer doctors, or the address looks like a doctor or team page.
  • Focused department page. A page department exists and there are 15 or fewer doctors.
  • Works-in allowed. True for a doctor page or a focused department page. This gates all works-in creation to prevent spurious doctor-department links on listing pages.

Strategy 1: Document-Level Address/Title Inference​

PropertyValue
RelationshipsWorks-in
Confidence0.85
GuardRequires a page department and works-in allowed

If a department can be identified from the page address or title, all extracted doctors on the page are linked to that department. Example: a consultation page for Cardiologie listing two doctors produces two works-in relationships to Cardiologie.

Strategy 2: Domain Knowledge Mapping​

PropertyValue
RelationshipsHandles, Offers, Performs, Treats
Confidence0.8 (handles, offers, performs), 0.85 (treats)
GuardPer-relationship plausibility checks

Applies taxonomy-driven maps when entities co-occur on a page:

  1. Department-condition map: department and condition on the same page gives Handles (guarded by a plausibility check).
  2. Department-treatment map: department and treatment gives Offers (guarded).
  3. Examination map: department and examination gives Performs (guarded).
  4. Treatment-condition map: treatment and condition gives Treats (a map match is sufficient).

Strategy 2b: Service-Department Linking​

PropertyValue
RelationshipsOffers
Confidence0.75

Links hospital services (for example "making an appointment") to the appropriate departments using a curated service-to-department map.

Strategy 3: All-Pairs for Focused Pages​

PropertyValue
RelationshipsWorks-in, Offers, Performs, Handles, Related-to
Confidence0.5 to 0.8 (varies by evidence)

On pages with few entities, assumes all co-occurring entities are related:

Entity PairCapConfidenceRelationship
Doctor-Departmentat most 3 doctors, 1 to 3 departments0.7Works-in
Department-Treatmentat most 2 departments0.75Offers
Department-Examinationat most 2 departments0.75Performs
Department-Conditionat most 3 departments0.5 to 0.8Handles
Treatment-Conditionboth non-empty0.6Related-to

Conditions mentioned in headings or early text receive higher confidence (0.8) than body-only mentions (0.5). Body-only mentions below the minimum confidence threshold (0.65) are filtered out.

Strategy 4: Sentence and Paragraph Co-occurrence​

PropertyValue
RelationshipsWorks-in, Works-at, Treats, Diagnoses, Used-for, Related-to, Offers, Performs
Confidence0.6 to 0.9

Two analysis levels:

Paragraph level (skipped on listing pages with more than 15 doctors or more than 10 departments):

  • Doctor and department in the same paragraph: works-in (0.65)
  • Treatment and condition: related-to (0.6)
  • Examination and condition: used-for (0.6)

Sentence level (always runs). Uses Dutch relationship indicator phrases (such as "werkt bij", "behandeling van", "diagnose van") to raise confidence when explicit textual evidence exists:

Pair TypeWith pattern matchWithout patternGuard
Doctor-DepartmentWorks-at (0.9)Works-in (0.75)Doctor-department validity check
Treatment-ConditionTreats (0.9)Related-to (0.7)Plausibility check
Exam-ConditionDiagnoses (0.9)Used-for (0.7)Plausibility check
Department-TreatmentOffers (0.8)Offers (0.8)Plausibility check
Department-ExamPerforms (0.8)Performs (0.8)Plausibility check

Strategy 5: Address-Inferred Specialty​

PropertyValue
RelationshipsWorks-in
Confidence0.75

Creates works-in from the specialty inferred from the page address when no department was explicitly extracted. For example, if a doctor appears on a skin-disease page, the doctor is tagged with the inferred department Dermatologie, and this strategy creates the relationship.

Strategy 6: Campus Relationships​

PropertyValue
RelationshipsLocated-at (facilities), Available-at (services)
Confidence0.7
GuardExactly one campus on the page

Links facilities and services to the single campus mentioned on a page. The single-campus guard prevents cross-product relationships (a page listing all campuses would otherwise link every service to every campus).

Strategy 7: Hospital Hierarchy​

PropertyValue
RelationshipsHas-campus, Belongs-to, Located-at
Confidence1.0 (hierarchy), 0.9 (located-at)

Runs unconditionally on every extraction and establishes the structural hierarchy:

  1. The hospital has each of its four campuses (confidence 1.0).
  2. Every department belongs to the hospital (confidence 1.0).
  3. Departments are located at campuses according to the configured department-campus map (confidence 0.9).

Strategy 7b: Doctor-Campus from Department-Campus​

PropertyValue
RelationshipsWorks-at-campus
Confidence0.85

Derives doctor-campus links from the chain doctor, works-in, department, located-at, campus. The link is only created if the department maps to a single campus (this prevents cross-products).

Strategy 8: Domain Knowledge Performs​

PropertyValue
RelationshipsPerforms
Confidence0.8

A page-independent strategy: whenever an examination entity is extracted, the examination map is consulted to create Performs relationships to the departments that perform it, regardless of page co-occurrence. Example: extracting "ECG" on any page triggers a Performs relationship from Cardiologie.

Plausibility Guard Framework​

Every relationship passes through plausibility guards before being accepted. The guards form a layered defence against spurious relationships.

Guard Functions​

Handles guard. Guards department-condition relationships:

  1. Diagnostic department block. Departments flagged as diagnostic (Radiologie, Labo, Nucleaire Geneeskunde, Pathologie) never get Handles relationships.
  2. Negative map. Blocks specific department-condition pairs (for example, the patient support service cannot handle clinical conditions).
  3. Hub concept guard. Overly broad conditions ("pijn", "tumor", "allergie", "infectie") only link to departments in allowed domain groups.
  4. Positive domain guard. If the department-condition map lists conditions for a department, only listed conditions pass.

Generic relationship guard. Guards Offers, Performs, Treats and Used-for:

  • Offers: four-layer validation (treatment blocklist, imaging department guard, positive treatment map, hub treatment guard).
  • Performs: imaging examinations (MRI, CT) only from imaging departments, plus domain group validation.
  • Treats and Used-for: cross-entity domain plausibility check.

Doctor-department guard. Guards works-in:

  • Uses a specialty-to-department map to validate that a doctor's specialty is compatible with the target department.
  • Prevents, for example, a cardiologist from being linked to Pediatrie because they appear on the same page.

Domain Groups​

Each department is assigned a domain group in the hospital configuration. Domain groups cluster clinically related departments and are used by the plausibility guards to validate cross-entity relationships.

Domain GroupExample Departments
CardiovascularCardiologie, Cardiochirurgie, Hartrevalidatie
SurgeryAlgemene Heelkunde, Orthopedie, Urologie, Plastische Chirurgie
OncologyOncologie, Hematologie, Radiotherapie
NeuroscienceNeurologie, Neurochirurgie
Internal medicineGastro-enterologie, Pneumologie, Nefrologie, Endocrinologie
Women and childrenGynaecologie, Materniteit, Pediatrie, Neonatologie
DiagnosticsRadiologie, Labo, Nucleaire Geneeskunde, Pathologie
SensoryOftalmologie, Keel- Neus- en Oorziekten
PsychiatryPsychiatrie, Kinder- en Jeugdpsychiatrie
Emergency and ICUSpoedgevallen, Intensieve Zorgen, MUG
RehabilitationFysische Geneeskunde, Revalidatie
SupportPatiëntenbegeleiding, Sociale Dienst, Diëtetiek
CentresSlaapcentrum, Pijncentrum, Borstcentrum

Hub Blocking​

Hub conditions. Generic terms like "pijn" (pain), "tumor", "allergie", "infectie" and "ontsteking" would connect to nearly every department if unchecked. They only link to departments in an allowed set of domain groups (typically oncology, emergency/ICU, and internal medicine).

Hub treatments. Generic treatments like "medicatie", "therapie" and "revalidatie" are similarly over-broad and are handled the same way.

Negative Maps​

A negative map explicitly blocks known-incorrect relationships:

  • Block all. Diagnostic departments and support departments that should never handle any condition. For example, Radiologie never gets a Handles relationship.
  • Specific blocks. Named conditions that a department should not handle. For example, clinical conditions such as diabetes, cancer and heart failure are blocked from the patient support department.

Confidence Scoring​

Confidence values are deterministic and source-based, not probabilistic. They encode the quality of evidence:

ConfidenceEvidence LevelExample
1.0Hub page listing or structural hierarchyA doctor from the hospital's doctor directory; the hospital has a campus
0.9Sentence-level pattern match or configuration-derived"works at Cardiologie" stated in a sentence; located-at from configuration
0.85Address/title inference or domain knowledge with TreatsStrategy 1, Strategy 7b
0.8Domain knowledge map matchStrategy 2 (Handles from the department-condition map)
0.75Focused page all-pairs or address-inferred specialtyStrategy 3 (department-treatment), Strategy 5
0.7Sentence co-occurrence without a pattern matchStrategy 4 (related-to from sentence proximity)
0.65Paragraph co-occurrenceStrategy 4 paragraph-level works-in
0.6Weak co-occurrence evidenceStrategy 3 (treatment-condition related-to)
0.5Body-only condition mentionStrategy 3 (condition in body text, no heading)

A minimum confidence threshold of 0.65 is applied when relationships are stored in the PostgreSQL-backed taxonomy, filtering out the weakest evidence.

Pipeline Flow​

When multiple strategies produce the same relationship (same source, target and type), deduplication keeps the one with the highest confidence value.

References​