vibe.review.parsing.semantic.nodes¶
Semantic layer node types.
These represent contract-specific semantics: - SemanticUnit: A numbered clause or section - Definition: A defined term with its meaning - CrossReference: A reference to another part of the document - Party: A contract party or signatory - SemanticDocument: Complete semantic analysis
SemanticUnit ¶
A semantic unit in the document (clause, section, etc.).
This represents a numbered or titled section of the contract with its hierarchical position and content. This is the canonical in-memory representation that converts to DocumentPartModel for persistence.
| Attributes: |
|
|---|
to_db_fields ¶
to_db_fields() -> dict[str, Any]
Extract fields for DocumentPartModel creation.
Returns a dict suitable for creating or updating a DocumentPartModel. Pipeline-specific fields (children_ids, etc.) are stored in metadata.
Definition ¶
A defined term in the contract.
| Attributes: |
|
|---|
CrossReference ¶
A cross-reference within the document.
| Attributes: |
|
|---|
Party ¶
A party to the contract.
| Attributes: |
|
|---|
SemanticDocument ¶
Complete semantic analysis of a document.
Contains all extracted semantic information: units, definitions, cross-references, and parties.
| Attributes: |
|
|---|
get_unit_by_number ¶
get_unit_by_number(number: str) -> SemanticUnit | None
Get a unit by its number.
get_definition ¶
get_definition(term: str) -> Definition | None
Get a definition by term (case-insensitive).