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?
| Criterion | Rule-based strategies | LLM relation extraction |
|---|---|---|
| Determinism | Identical output for identical input | Non-deterministic |
| Auditability | Each relationship tagged with strategy and confidence | Black-box output |
| Cost | No marginal cost per page | An API call per page |
| Latency | Milliseconds per page | Seconds per page |
| Coverage | Limited to known patterns | Can 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
| Property | Value |
|---|---|
| Relationships | Works-in |
| Confidence | 0.85 |
| Guard | Requires 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
| Property | Value |
|---|---|
| Relationships | Handles, Offers, Performs, Treats |
| Confidence | 0.8 (handles, offers, performs), 0.85 (treats) |
| Guard | Per-relationship plausibility checks |
Applies taxonomy-driven maps when entities co-occur on a page:
- Department-condition map: department and condition on the same page gives Handles (guarded by a plausibility check).
- Department-treatment map: department and treatment gives Offers (guarded).
- Examination map: department and examination gives Performs (guarded).
- Treatment-condition map: treatment and condition gives Treats (a map match is sufficient).
Strategy 2b: Service-Department Linking
| Property | Value |
|---|---|
| Relationships | Offers |
| Confidence | 0.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
| Property | Value |
|---|---|
| Relationships | Works-in, Offers, Performs, Handles, Related-to |
| Confidence | 0.5 to 0.8 (varies by evidence) |
On pages with few entities, assumes all co-occurring entities are related:
| Entity Pair | Cap | Confidence | Relationship |
|---|---|---|---|
| Doctor-Department | at most 3 doctors, 1 to 3 departments | 0.7 | Works-in |
| Department-Treatment | at most 2 departments | 0.75 | Offers |
| Department-Examination | at most 2 departments | 0.75 | Performs |
| Department-Condition | at most 3 departments | 0.5 to 0.8 | Handles |
| Treatment-Condition | both non-empty | 0.6 | Related-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
| Property | Value |
|---|---|
| Relationships | Works-in, Works-at, Treats, Diagnoses, Used-for, Related-to, Offers, Performs |
| Confidence | 0.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 Type | With pattern match | Without pattern | Guard |
|---|---|---|---|
| Doctor-Department | Works-at (0.9) | Works-in (0.75) | Doctor-department validity check |
| Treatment-Condition | Treats (0.9) | Related-to (0.7) | Plausibility check |
| Exam-Condition | Diagnoses (0.9) | Used-for (0.7) | Plausibility check |
| Department-Treatment | Offers (0.8) | Offers (0.8) | Plausibility check |
| Department-Exam | Performs (0.8) | Performs (0.8) | Plausibility check |
Strategy 5: Address-Inferred Specialty
| Property | Value |
|---|---|
| Relationships | Works-in |
| Confidence | 0.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
| Property | Value |
|---|---|
| Relationships | Located-at (facilities), Available-at (services) |
| Confidence | 0.7 |
| Guard | Exactly 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
| Property | Value |
|---|---|
| Relationships | Has-campus, Belongs-to, Located-at |
| Confidence | 1.0 (hierarchy), 0.9 (located-at) |
Runs unconditionally on every extraction and establishes the structural hierarchy:
- The hospital has each of its four campuses (confidence 1.0).
- Every department belongs to the hospital (confidence 1.0).
- Departments are located at campuses according to the configured department-campus map (confidence 0.9).
Strategy 7b: Doctor-Campus from Department-Campus
| Property | Value |
|---|---|
| Relationships | Works-at-campus |
| Confidence | 0.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
| Property | Value |
|---|---|
| Relationships | Performs |
| Confidence | 0.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:
- Diagnostic department block. Departments flagged as diagnostic (Radiologie, Labo, Nucleaire Geneeskunde, Pathologie) never get Handles relationships.
- Negative map. Blocks specific department-condition pairs (for example, the patient support service cannot handle clinical conditions).
- Hub concept guard. Overly broad conditions ("pijn", "tumor", "allergie", "infectie") only link to departments in allowed domain groups.
- 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 Group | Example Departments |
|---|---|
| Cardiovascular | Cardiologie, Cardiochirurgie, Hartrevalidatie |
| Surgery | Algemene Heelkunde, Orthopedie, Urologie, Plastische Chirurgie |
| Oncology | Oncologie, Hematologie, Radiotherapie |
| Neuroscience | Neurologie, Neurochirurgie |
| Internal medicine | Gastro-enterologie, Pneumologie, Nefrologie, Endocrinologie |
| Women and children | Gynaecologie, Materniteit, Pediatrie, Neonatologie |
| Diagnostics | Radiologie, Labo, Nucleaire Geneeskunde, Pathologie |
| Sensory | Oftalmologie, Keel- Neus- en Oorziekten |
| Psychiatry | Psychiatrie, Kinder- en Jeugdpsychiatrie |
| Emergency and ICU | Spoedgevallen, Intensieve Zorgen, MUG |
| Rehabilitation | Fysische Geneeskunde, Revalidatie |
| Support | Patiëntenbegeleiding, Sociale Dienst, Diëtetiek |
| Centres | Slaapcentrum, 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:
| Confidence | Evidence Level | Example |
|---|---|---|
| 1.0 | Hub page listing or structural hierarchy | A doctor from the hospital's doctor directory; the hospital has a campus |
| 0.9 | Sentence-level pattern match or configuration-derived | "works at Cardiologie" stated in a sentence; located-at from configuration |
| 0.85 | Address/title inference or domain knowledge with Treats | Strategy 1, Strategy 7b |
| 0.8 | Domain knowledge map match | Strategy 2 (Handles from the department-condition map) |
| 0.75 | Focused page all-pairs or address-inferred specialty | Strategy 3 (department-treatment), Strategy 5 |
| 0.7 | Sentence co-occurrence without a pattern match | Strategy 4 (related-to from sentence proximity) |
| 0.65 | Paragraph co-occurrence | Strategy 4 paragraph-level works-in |
| 0.6 | Weak co-occurrence evidence | Strategy 3 (treatment-condition related-to) |
| 0.5 | Body-only condition mention | Strategy 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
- Hogan, A., et al. (2021). Knowledge graphs. ACM Computing Surveys, 54(4), 1--37. https://doi.org/10.1145/3447772
- Mintz, M., Bills, S., Snow, R., & Jurafsky, D. (2009). Distant supervision for relation extraction without labeled data. Proceedings of ACL 2009, 1003--1011. https://aclanthology.org/P09-1113