smurthy5 commited on
Commit
87106bc
·
verified ·
1 Parent(s): daebb15

Upload data/schema.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. data/schema.md +267 -0
data/schema.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CrossER v2 Data Schema
2
+
3
+ ## entities.json
4
+
5
+ ```json
6
+ {
7
+ "entity_id": "tc2_prod_0001",
8
+ "source_system": "SAP_TC2",
9
+ "entity_type": "product",
10
+ "name": "Maltodextrin DE20 Grade A",
11
+ "attributes": {
12
+ "category": "starches",
13
+ "sub_category": "maltodextrin",
14
+ "cn_code": "CN 1702.90",
15
+ "dextrose_equivalent": 20,
16
+ "grade": "A",
17
+ "region": "NA",
18
+ "cost_center": "CC-412",
19
+ "status": "active"
20
+ }
21
+ }
22
+ ```
23
+
24
+ ### Source Systems
25
+
26
+ | System | ID Prefix | Naming Style | Completeness |
27
+ |--------|-----------|-------------|-------------|
28
+ | SAP_TC2 | `tc2_` | Formal English | 95% |
29
+ | SAP_CFIN | `cfin_` | Internal codes | 90% |
30
+ | SAP_APAC | `apac_` | Abbreviated | 60% |
31
+ | LEGACY_ERP | `leg_` | Cryptic codes | 45% |
32
+ | SHAREPOINT | `sp_` | Authoritative | 85% |
33
+
34
+ ### Entity Types
35
+ - `product` — Physical products (starches, sugars, acids, proteins, oils)
36
+ - `supplier` — Vendor/supplier companies
37
+ - `tax_code` — Tax classification codes (CN/HS codes)
38
+ - `legal_entity` — Legal entities / subsidiaries
39
+
40
+ ## pairs.json
41
+
42
+ ```json
43
+ {
44
+ "pair_id": "pair_0001",
45
+ "entity_a": "tc2_prod_0001",
46
+ "entity_b": "cfin_prod_0001",
47
+ "label": "match",
48
+ "string_similarity": 0.234,
49
+ "attribute_overlap": 0.500,
50
+ "difficulty_tier": "hard",
51
+ "entity_type": "product",
52
+ "system_pair": ["SAP_CFIN", "SAP_TC2"]
53
+ }
54
+ ```
55
+
56
+ ### Labels
57
+ - `match` — Same real-world entity
58
+ - `no_match` — Different entities
59
+ - `ambiguous` — Requires human judgment
60
+
61
+ ### Difficulty Tiers
62
+ - `easy` — String sim >= 0.70
63
+ - `medium` — String sim 0.30-0.70
64
+ - `hard` — String sim < 0.30
65
+ - `adversarial_negative` — High similarity but NOT a match
66
+ - `medium_negative` / `obvious_negative` — No-match tiers
67
+
68
+ ## Splits & Subsets
69
+
70
+ - `splits/{train,val,test}.json` — 40/20/40 stratified split
71
+ - `subsets/crosser_easy.json` — Easy-tier test pairs
72
+ - `subsets/crosser_hard.json` — Hard + adversarial test pairs
73
+
74
+ ## Oracle Context
75
+
76
+ - `context/structured/oracle_context.json` — Complete pairwise migration records
77
+ - `context/structured/alias_table.json` — Canonical entity alias groups
78
+
79
+ ## Demo Subset
80
+
81
+ - `demo/*.csv` — Per-system entity CSVs
82
+ - `demo/ground_truth.csv` — Labeled pairs
83
+ - `demo/rules.yaml` — Business rules
84
+ - `demo/knowledge.yaml` — Domain knowledge artifacts
85
+
86
+ ---
87
+
88
+ # Extended Pipelines (--pipeline full)
89
+
90
+ ## Email Chains (`email_chains/`)
91
+
92
+ ```json
93
+ // chains.json — array of email threads
94
+ {
95
+ "chain_id": "email_chain_0001",
96
+ "domain": "commodity_trading",
97
+ "messages": [
98
+ {
99
+ "message_id": "email_chain_0001_msg_001",
100
+ "sender": "s.chen@globalfoods.com",
101
+ "sender_name": "Sarah Chen",
102
+ "sender_role": "Operations Manager, North America",
103
+ "recipients": ["j.morrison@globalfoods.com"],
104
+ "subject": "RE: Is Maltodextrin DE20 Grade A in SAP_TC2 the same as record in SAP_CFIN?",
105
+ "body": "...",
106
+ "timestamp": "2025-07-15T09:00:00"
107
+ }
108
+ ]
109
+ }
110
+ ```
111
+
112
+ ### Email Prediction Format
113
+
114
+ ```json
115
+ [
116
+ {
117
+ "chain_id": "email_chain_0001",
118
+ "extracted_knowledge": [{"type": "entity_mapping", "description": "..."}],
119
+ "extracted_relationships": [{"type": "discussed_in_context", "entities_involved": 2}],
120
+ "extracted_corrections": [{"type": "expert_correction", "source_message_ids": ["..."]}]
121
+ }
122
+ ]
123
+ ```
124
+
125
+ ## Support Tickets (`tickets/`)
126
+
127
+ ```json
128
+ // tickets.json
129
+ {
130
+ "ticket_id": "TKT-0001",
131
+ "domain": "commodity_trading",
132
+ "title": "Product ID mismatch between SAP_TC2 and SAP_CFIN",
133
+ "priority": "high",
134
+ "resolution": {
135
+ "resolution_type": "entity_mapping",
136
+ "verdict": "confirmed_match",
137
+ "confidence": 0.95,
138
+ "reasoning": "..."
139
+ },
140
+ "referenced_precedents": ["TKT-0003"]
141
+ }
142
+ ```
143
+
144
+ ### Ticket Prediction Format
145
+
146
+ ```json
147
+ [
148
+ {
149
+ "ticket_id": "TKT-0001",
150
+ "predicted_resolution": "confirmed_match",
151
+ "referenced_precedent_ids": ["TKT-0003"],
152
+ "extracted_knowledge": [{"type": "entity_mapping", "description": "..."}]
153
+ }
154
+ ]
155
+ ```
156
+
157
+ ## ERP Events (`erp_events/`)
158
+
159
+ ```json
160
+ // events.json
161
+ {
162
+ "event_id": "EVT-000001",
163
+ "timestamp": "2025-01-15T10:30:00",
164
+ "source_system": "SAP_TC2",
165
+ "event_type": "purchase_order_created",
166
+ "entity_refs": [
167
+ {"entity_type": "product", "id": "TC2-1234", "name": "Maltodextrin DE20 Grade A"},
168
+ {"entity_type": "supplier", "id": "SUP-12345", "name": "Cargill Inc."}
169
+ ],
170
+ "attributes": {"amount": 50000.00, "currency": "USD"},
171
+ "related_events": ["EVT-000002"]
172
+ }
173
+ ```
174
+
175
+ ### ERP Prediction Format
176
+
177
+ ```json
178
+ [
179
+ {
180
+ "event_id": "EVT-000001",
181
+ "linked_entity_ids": ["EVT-000002"],
182
+ "normalized_event_type": "purchase_order_created"
183
+ }
184
+ ]
185
+ ```
186
+
187
+ ## Cases (`cases/`)
188
+
189
+ ```json
190
+ // cases.json
191
+ {
192
+ "case_id": "CASE-0001",
193
+ "case_type": "entity_disambiguation",
194
+ "domain": "commodity_trading",
195
+ "linked_entities": [...],
196
+ "resolution": {"verdict": "approved", "confidence": 0.9, "evidence": [...]},
197
+ "cited_precedents": ["CASE-0003"]
198
+ }
199
+ ```
200
+
201
+ ### Case Prediction Format
202
+
203
+ ```json
204
+ [
205
+ {
206
+ "case_id": "CASE-0001",
207
+ "predicted_precedent_ids": ["CASE-0003", "CASE-0007"],
208
+ "predicted_resolution": "approved",
209
+ "context_entities": ["entity_a", "entity_b"]
210
+ }
211
+ ]
212
+ ```
213
+
214
+ ## Corrections (`corrections/`)
215
+
216
+ ```json
217
+ // sequences.json
218
+ {
219
+ "sequence_id": "CORR-0001",
220
+ "pattern_id": "entity_mapping_fix",
221
+ "domain": "commodity_trading",
222
+ "steps": [
223
+ {"step_index": 0, "step_type": "system_proposes_mapping", ...},
224
+ {"step_index": 1, "step_type": "expert_reviews", ...},
225
+ {"step_index": 2, "step_type": "expert_rejects", ...},
226
+ {"step_index": 3, "step_type": "expert_provides_correct_mapping", ...}
227
+ ]
228
+ }
229
+ ```
230
+
231
+ ### Correction Prediction Format
232
+
233
+ ```json
234
+ [
235
+ {
236
+ "sequence_id": "CORR-0001",
237
+ "generated_rules": [{"type": "override_mapping", "condition": "...", "action": "..."}],
238
+ "updated_mappings": [{"entity_a": "...", "entity_b": "...", "is_match": true}]
239
+ }
240
+ ]
241
+ ```
242
+
243
+ ## Knowledge Documents (`knowledge_docs/`)
244
+
245
+ ```json
246
+ // manifest.json
247
+ {
248
+ "doc_id": "KDOC-0001",
249
+ "filename": "KDOC-0001_concept_commodity_trading.md",
250
+ "title": "Concept: Dextrose Equivalent and Its Impact on Classification",
251
+ "doc_type": "concept",
252
+ "domain": "commodity_trading"
253
+ }
254
+ ```
255
+
256
+ ### Knowledge Prediction Format
257
+
258
+ ```json
259
+ [
260
+ {
261
+ "doc_id": "KDOC-0001",
262
+ "extracted_artifacts": [
263
+ {"type": "concept", "content": "...", "entities": [...], "confidence": 0.95}
264
+ ]
265
+ }
266
+ ]
267
+ ```