File size: 625 Bytes
908ff10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3487f22
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from typing import TypedDict, List


class Clause(TypedDict, total=False):
    id: int
    text: str
    section: str
    clause_type: str
    confidence: float
    risk_score: float
    risk_factors: List[str]
    benchmark_similarity: float
    benchmark_source: str


class ContractState(TypedDict, total=False):
    raw_text: str
    clauses: List[Clause]
    classified_clauses: List[Clause]
    risk_scores: List[Clause]
    benchmark_results: List[Clause]
    report: str
    # New, knowledge Graph:
    entities: List[dict]
    relationships: List[dict]
    graph_image_path: str  # path to saved knowledge graph PNG