decomp.semantics.predpatt.graph

Graph builders for converting PredPatt extractions to NetworkX graph representations compatible with UDS.

Graph construction for PredPatt semantic extractions.

This module provides functionality for converting PredPatt extractions into unified NetworkX graphs that combine syntactic dependencies with semantic predicate-argument structures.

Classes

PredPattGraphBuilder

Static methods for building NetworkX graphs from PredPatt extractions, creating unified representations with syntax, semantics, and interface layers.

class PredPattGraphBuilder[source]

Bases: object

Constructs NetworkX graphs from PredPatt extractions.

This class provides static methods for converting PredPatt’s predicate and argument objects into a unified graph representation that includes both syntactic dependencies and semantic relations.

classmethod from_predpatt(predpatt, depgraph, graphid='')[source]

Build a unified graph from PredPatt extraction and dependency parse.

Creates a NetworkX graph that contains: - All syntax nodes and edges from the original dependency parse - Semantic predicate and argument nodes extracted by PredPatt - Interface edges linking semantic nodes to their syntactic heads - Semantic edges connecting predicates to their arguments

Parameters:
  • predpatt (PredPatt) – The PredPatt extraction containing identified predicates and arguments

  • depgraph (DiGraph) – The source dependency graph with syntactic relations

  • graphid (str, optional) – Identifier prefix for all nodes in the graph. Default is empty string

Returns:

NetworkX graph with nodes in three domains: - syntax: original dependency parse nodes - semantics: predicate and argument nodes - interface: edges linking syntax and semantics

Return type:

DiGraph