ZahirJS commited on
Commit
b5eb4ed
·
verified ·
1 Parent(s): be24499

Update synoptic_chart_generator.py

Browse files
Files changed (1) hide show
  1. synoptic_chart_generator.py +54 -10
synoptic_chart_generator.py CHANGED
@@ -12,9 +12,6 @@ def generate_synoptic_chart(json_input: str) -> str: # Removed base_color parame
12
  json_input (str): A JSON string describing the synoptic chart structure.
13
  It must follow the Expected JSON Format Example below.
14
 
15
- Returns:
16
- str: The filepath to the generated PNG image file.
17
-
18
  Expected JSON Format Example:
19
  {
20
  "central_node": "AI Project Lifecycle",
@@ -22,15 +19,24 @@ def generate_synoptic_chart(json_input: str) -> str: # Removed base_color parame
22
  {
23
  "id": "phase1",
24
  "label": "I. Problem Definition & Data Acquisition",
25
- "relationship": "Starts\\nwith",
26
  "subnodes": [
27
  {
28
  "id": "sub1_1",
29
  "label": "1. Problem Formulation",
30
- "relationship": "Involves\\n(Steps)",
 
 
 
 
 
 
 
 
 
31
  "subnodes": [
32
- {"id": "sub1_1_1", "label": "1.1. Identify Business Need", "relationship": "e.g.\\n(Need)"},
33
- {"id": "sub1_1_2", "label": "1.2. Define KPIs", "relationship": "e.g.\\n(Metrics)"}
34
  ]
35
  }
36
  ]
@@ -38,20 +44,58 @@ def generate_synoptic_chart(json_input: str) -> str: # Removed base_color parame
38
  {
39
  "id": "phase2",
40
  "label": "II. Model Development",
41
- "relationship": "Proceeds\\nto",
42
  "subnodes": [
43
  {
44
  "id": "sub2_1",
45
  "label": "1. Feature Engineering",
46
- "relationship": "Comprises\\n(Features)",
47
  "subnodes": [
48
- {"id": "sub2_1_1", "label": "1.1. Feature Selection", "relationship": "e.g.\\n(Select)"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ]
50
  }
51
  ]
52
  }
53
  ]
54
  }
 
 
 
55
  """
56
  try:
57
  if not json_input.strip():
 
12
  json_input (str): A JSON string describing the synoptic chart structure.
13
  It must follow the Expected JSON Format Example below.
14
 
 
 
 
15
  Expected JSON Format Example:
16
  {
17
  "central_node": "AI Project Lifecycle",
 
19
  {
20
  "id": "phase1",
21
  "label": "I. Problem Definition & Data Acquisition",
22
+ "relationship": "Starts with",
23
  "subnodes": [
24
  {
25
  "id": "sub1_1",
26
  "label": "1. Problem Formulation",
27
+ "relationship": "Involves",
28
+ "subnodes": [
29
+ {"id": "sub1_1_1", "label": "1.1. Identify Business Need", "relationship": "e.g."},
30
+ {"id": "sub1_1_2", "label": "1.2. Define KPIs", "relationship": "e.g."}
31
+ ]
32
+ },
33
+ {
34
+ "id": "sub1_2",
35
+ "label": "2. Data Collection",
36
+ "relationship": "Followed by",
37
  "subnodes": [
38
+ {"id": "sub1_2_1", "label": "2.1. Source Data", "relationship": "from"},
39
+ {"id": "sub1_2_2", "label": "2.2. Data Cleaning", "relationship": "includes"}
40
  ]
41
  }
42
  ]
 
44
  {
45
  "id": "phase2",
46
  "label": "II. Model Development",
47
+ "relationship": "Proceeds to",
48
  "subnodes": [
49
  {
50
  "id": "sub2_1",
51
  "label": "1. Feature Engineering",
52
+ "relationship": "Comprises",
53
  "subnodes": [
54
+ {"id": "sub2_1_1", "label": "1.1. Feature Selection", "relationship": "e.g."},
55
+ {"id": "sub2_1_2", "label": "1.2. Feature Transformation", "relationship": "e.g."}
56
+ ]
57
+ },
58
+ {
59
+ "id": "sub2_2",
60
+ "label": "2. Model Training",
61
+ "relationship": "Involves",
62
+ "subnodes": [
63
+ {"id": "sub2_2_1", "label": "2.1. Algorithm Selection", "relationship": "uses"},
64
+ {"id": "sub2_2_2", "label": "2.2. Hyperparameter Tuning", "relationship": "optimizes"}
65
+ ]
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "id": "phase3",
71
+ "label": "III. Evaluation & Deployment",
72
+ "relationship": "Culminates in",
73
+ "subnodes": [
74
+ {
75
+ "id": "sub3_1",
76
+ "label": "1. Model Evaluation",
77
+ "relationship": "Includes",
78
+ "subnodes": [
79
+ {"id": "sub3_1_1", "label": "1.1. Performance Metrics", "relationship": "measures"},
80
+ {"id": "sub3_1_2", "label": "1.2. Bias & Fairness Audits", "relationship": "ensures"}
81
+ ]
82
+ },
83
+ {
84
+ "id": "sub3_2",
85
+ "label": "2. Deployment & Monitoring",
86
+ "relationship": "Requires",
87
+ "subnodes": [
88
+ {"id": "sub3_2_1", "label": "2.1. API/Integration Development", "relationship": "for"},
89
+ {"id": "sub3_2_2", "label": "2.2. Continuous Monitoring", "relationship": "ensures"}
90
  ]
91
  }
92
  ]
93
  }
94
  ]
95
  }
96
+
97
+ Returns:
98
+ str: The filepath to the generated PNG image file.
99
  """
100
  try:
101
  if not json_input.strip():