Skip to content

Commit d84f433

Browse files
committed
updated the multimodal classification notebooks to use local modular config
1 parent 3560415 commit d84f433

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

notebooks/examples/step2_classification.ipynb

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,28 @@
9191
"print(f\"Loaded document: {document.id}\")\n",
9292
"print(f\"Number of pages: {document.num_pages}\")\n",
9393
"\n",
94-
"# Load classification configuration with boundary detection\n",
95-
"config_path = Path('../../config_library/pattern-2/lending-package-sample/config_multimodal_page_boundary.yaml')\n",
96-
"with open(config_path) as f:\n",
97-
" config = yaml.safe_load(f)\n",
94+
"# Load configuration directly from config files\n",
95+
"config_dir = Path(\"config\")\n",
96+
"CONFIG = {}\n",
97+
"\n",
98+
"# Load each configuration file\n",
99+
"config_files = [\n",
100+
" \"classification.yaml\", \n",
101+
" \"classes.yaml\"\n",
102+
"]\n",
103+
"\n",
104+
"for config_file in config_files:\n",
105+
" config_path = config_dir / config_file\n",
106+
" if config_path.exists():\n",
107+
" with open(config_path, 'r') as f:\n",
108+
" file_config = yaml.safe_load(f)\n",
109+
" CONFIG.update(file_config)\n",
110+
" print(f\"Loaded {config_file}\")\n",
111+
" else:\n",
112+
" print(f\"Warning: {config_file} not found\")\n",
113+
"\n",
114+
"# Use CONFIG as the main config object\n",
115+
"config = CONFIG\n",
98116
"\n",
99117
"# Display configuration details\n",
100118
"classification_config = config.get('classification', {})\n",

0 commit comments

Comments
 (0)