File size: 3,634 Bytes
7ff7119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  "type": "object",
  "title": "UniversalSchema",
  "description": "Universal schema for any business document that does not fit one of the 5 specific schemas (e.g. quote, mandate, minutes). flatten_universal maps it to flat field names for the downstream domain checks.",
  "properties": {
    "document_type": { "type": ["string", "null"] },
    "document_language": { "type": "string", "default": "en" },
    "document_number": { "type": ["string", "null"] },
    "parties": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": ["string", "null"] },
          "role": { "type": ["string", "null"] },
          "tax_id": { "type": ["string", "null"] },
          "address": { "type": ["string", "null"] },
          "contact": { "type": ["string", "null"] }
        }
      }
    },
    "dates": {
      "type": "object",
      "properties": {
        "issue": { "type": ["string", "null"] },
        "fulfillment": { "type": ["string", "null"] },
        "payment_due": { "type": ["string", "null"] },
        "effective": { "type": ["string", "null"] },
        "expiry": { "type": ["string", "null"] },
        "signature": { "type": ["string", "null"] },
        "other_dates": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": { "type": "string" },
              "date": { "type": "string" }
            }
          }
        }
      }
    },
    "amounts": {
      "type": "object",
      "properties": {
        "total_net": { "type": ["number", "null"] },
        "total_vat": { "type": ["number", "null"] },
        "total_gross": { "type": ["number", "null"] },
        "currency": { "type": "string", "default": "USD" },
        "vat_rate": { "type": ["number", "null"] }
      }
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "item_code": { "type": ["string", "null"] },
          "description": { "type": ["string", "null"] },
          "quantity": { "type": ["number", "null"] },
          "unit": { "type": ["string", "null"] },
          "unit_price_net": { "type": ["number", "null"] },
          "vat_rate": { "type": ["number", "null"] },
          "total_net": { "type": ["number", "null"] },
          "total_vat": { "type": ["number", "null"] },
          "total_gross": { "type": ["number", "null"] }
        }
      }
    },
    "contract_elements": {
      "type": ["object", "null"],
      "properties": {
        "contract_type": { "type": ["string", "null"] },
        "termination_terms": { "type": ["string", "null"] },
        "penalty": { "type": ["object", "null"] },
        "confidentiality_clause": { "type": ["boolean", "null"] },
        "governing_law": { "type": ["string", "null"] },
        "key_clauses": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "content": { "type": "string" },
              "risk_level": { "type": "string", "enum": ["low", "medium", "high"] }
            }
          }
        }
      }
    },
    "risk_elements": {
      "type": "array",
      "items": { "type": "string" }
    },
    "_quotes": { "type": "array", "items": { "type": "string" } },
    "_confidence": { "type": "object" },
    "_source": {
      "type": "object",
      "properties": {
        "file_name": { "type": "string" },
        "page_number": { "type": ["integer", "null"] }
      }
    }
  },
  "required": ["_quotes", "_confidence"]
}