liveBook · Manning

Path-to-text translation

As explained in Knowledge Graphs and LLMs in Action

Path-to-text translation is the conversion of a graph path and its relationships into a natural-language textual representation.

Path-to-text translation converts graph paths and relationship types into natural-language sentences so language models can interpret relational evidence during biomedical named entity disambiguation. section 8.4.3

A practical translation pipeline proceeds as follows:

  • Detect short paths between candidate entities, typically limiting searches to one or two hops and excluding highly connected hub nodes. section 8.4.3
  • Format each path with entity names, relationship directions, and relationship types before sending it to a language model. section 8.4.3
  • Require exact entity names and valid JSON so translated sentences can be processed reliably downstream. section 8.4.3
  • Summarize the translated sentences into synthetic context for the final disambiguation decision. section 8.4.3

Biomedical risk-path translation

The path `(Hypertension)-[:RISK_FACTOR_FOR]->(Cardiovascular Disease)<-[:ASSOCIATED_WITH]-(Myocardial Infarction)` becomes a sentence stating that hypertension is a risk factor for cardiovascular disease, while myocardial infarction is also associated with it. The resulting context supports entity disambiguation. section 8.4.3

Figure 8.6 NED CD steps: (1) detecting the shortest paths between all the candidates related to the entity mentions in the sentence; (2) translating detected paths into natural language sentences; (3) summarizing those sentences into useful text for disambiguation
figure

Follow the three-stage workflow: detect shortest paths, translate them into natural-language sentences, and summarize the resulting context. section 8.4.3

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Explains a pipeline from shortest-path extraction through translation and summarization, but defers broader model and graph implementation details.
Examples
Uses hypertension–cardiovascular disease–myocardial infarction paths and congenital Zika infection–malformation paths as translation examples.
What it assumes
Assumes candidate entities, graph relationships, shortest-path search, and language-model prompting within a named entity disambiguation workflow.
What you can do after
Apply it via Neo4j GDS and an LLM to generate contextual sentences that improve candidate-entity disambiguation.
How it connects
Connects named entity disambiguation, knowledge graphs, shortest-path search, SNOMED, Neo4j GDS, large language models, and textual path summarization.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.