sci-fi-parser 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sci_fi_parser-0.1.0/.coveragerc +2 -0
- sci_fi_parser-0.1.0/.github/workflows/ci.yaml +34 -0
- sci_fi_parser-0.1.0/.gitignore +216 -0
- sci_fi_parser-0.1.0/.readthedocs.yaml +24 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data analysis and standardization/AccuracyTesting.md +21 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data analysis and standardization/DataSaving.md +323 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data analysis and standardization/SQL.md +21 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data analysis and standardization/Standardization.md +21 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data extraction/ClassChooser.md +21 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data extraction/OCR.md +176 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data extraction/VLM.md +78 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data input and classificiation/Classifier.md +100 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Data input and classificiation/DataLoader.md +82 -0
- sci_fi_parser-0.1.0/Dev Documentantion/Tools/TrainingData.md +52 -0
- sci_fi_parser-0.1.0/LICENSE +21 -0
- sci_fi_parser-0.1.0/PKG-INFO +70 -0
- sci_fi_parser-0.1.0/README.md +31 -0
- sci_fi_parser-0.1.0/docs/Makefile +20 -0
- sci_fi_parser-0.1.0/docs/make.bat +35 -0
- sci_fi_parser-0.1.0/docs/source/api.rst +14 -0
- sci_fi_parser-0.1.0/docs/source/cli.rst +93 -0
- sci_fi_parser-0.1.0/docs/source/conf.py +18 -0
- sci_fi_parser-0.1.0/docs/source/index.rst +14 -0
- sci_fi_parser-0.1.0/docs/source/usage.rst +44 -0
- sci_fi_parser-0.1.0/mypy.ini +5 -0
- sci_fi_parser-0.1.0/notebooks/API_demonstration.ipynb +196 -0
- sci_fi_parser-0.1.0/pyproject.toml +85 -0
- sci_fi_parser-0.1.0/ruff.toml +22 -0
- sci_fi_parser-0.1.0/scripts/__init__.py +0 -0
- sci_fi_parser-0.1.0/scripts/filter_benetech_vertical_bars.py +132 -0
- sci_fi_parser-0.1.0/scripts/synthetic/__init__.py +31 -0
- sci_fi_parser-0.1.0/scripts/synthetic/_backend.py +10 -0
- sci_fi_parser-0.1.0/scripts/synthetic/cli.py +167 -0
- sci_fi_parser-0.1.0/scripts/synthetic/config.py +172 -0
- sci_fi_parser-0.1.0/scripts/synthetic/generate.py +94 -0
- sci_fi_parser-0.1.0/scripts/synthetic/output.py +84 -0
- sci_fi_parser-0.1.0/scripts/synthetic/render.py +311 -0
- sci_fi_parser-0.1.0/scripts/synthetic/style.py +191 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/__init__.py +5 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/api.py +184 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/README.md +130 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/__init__.py +12 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/bench_pipeline.py +234 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/benchmark.py +441 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/draw_lap.py +425 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/report_adapter.py +42 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/scoring.py +83 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/truth.py +98 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/benchmark/vlm_compare.py +760 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/classifier/__init__.py +0 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/classifier/classifier_pipeline.py +18 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/classifier/cnn.py +89 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/classifier/image_classifier.py +112 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/cli.py +62 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/config/synthetic_bars.toml +84 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/config/vlm.toml +13 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/config/vlm_comparison.toml +68 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/config/vlm_smoke.toml +34 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/image_extraction/extraction_pipeline.py +78 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/image_extraction/image_loader.py +41 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/image_extraction/image_parser.py +150 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/main.py +37 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/__init__.py +0 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/computer_vision/bars.py +157 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/computer_vision/config.py +15 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/computer_vision/lines.py +100 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/debug_draw.py +130 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/detection_pipeline.py +149 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/object_detection/ocr.py +69 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/schema.py +217 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/storage/writer.py +139 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/vlm/__init__.py +0 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/vlm/vlm.py +110 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/vlm/vlm_config.py +68 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/vlm/vlm_pipeline.py +45 -0
- sci_fi_parser-0.1.0/src/sci_fi_parser/vlm/vlm_schema.py +25 -0
- sci_fi_parser-0.1.0/tests/__init__.py +0 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/benchmark/test_schema.py +53 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/classifier/test_cnn.py +36 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/classifier/test_image_classifier.py +21 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/image_extraction/test_extraction_pipeline.py +55 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/image_extraction/test_image_parser.py +191 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/object_detection/test_bars.py +192 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/object_detection/test_detection_pipeline.py +116 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/object_detection/test_ocr.py +44 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/test_api.py +173 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/test_cli.py +80 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/vlm/test_vlm.py +126 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/vlm/test_vlm_config.py +34 -0
- sci_fi_parser-0.1.0/tests/sci_fi_parser/vlm/test_vlm_pipeline.py +97 -0
- sci_fi_parser-0.1.0/tests/test_materials/0a14bb795a27.jpg +0 -0
- sci_fi_parser-0.1.0/uv.lock +3347 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
|
|
15
|
+
- uses: astral-sh/setup-uv@v1
|
|
16
|
+
with:
|
|
17
|
+
version: "latest"
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: uv sync --group dev
|
|
21
|
+
|
|
22
|
+
- name: Run unit tests
|
|
23
|
+
run: uv run pytest --cov --cov-branch --cov-report=xml
|
|
24
|
+
|
|
25
|
+
- name: Upload coverage reports to Codecov
|
|
26
|
+
uses: codecov/codecov-action@v5
|
|
27
|
+
with:
|
|
28
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
29
|
+
|
|
30
|
+
- name: Check formatting
|
|
31
|
+
run: uv run ruff format --check .
|
|
32
|
+
|
|
33
|
+
- name: Lint
|
|
34
|
+
run: uv run ruff check .
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
test_images/
|
|
2
|
+
cnn_data_split/
|
|
3
|
+
temp/
|
|
4
|
+
|
|
5
|
+
# Byte-compiled / optimized / DLL files
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[codz]
|
|
8
|
+
*$py.class
|
|
9
|
+
|
|
10
|
+
# C extensions
|
|
11
|
+
*.so
|
|
12
|
+
|
|
13
|
+
# Distribution / packaging
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
train_data/
|
|
17
|
+
reports/
|
|
18
|
+
develop-eggs/
|
|
19
|
+
dist/
|
|
20
|
+
downloads/
|
|
21
|
+
eggs/
|
|
22
|
+
.eggs/
|
|
23
|
+
lib/
|
|
24
|
+
lib64/
|
|
25
|
+
parts/
|
|
26
|
+
sdist/
|
|
27
|
+
var/
|
|
28
|
+
wheels/
|
|
29
|
+
share/python-wheels/
|
|
30
|
+
*.egg-info/
|
|
31
|
+
.installed.cfg
|
|
32
|
+
*.egg
|
|
33
|
+
MANIFEST
|
|
34
|
+
output
|
|
35
|
+
.claude
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# PyInstaller
|
|
39
|
+
# Usually these files are written by a python script from a template
|
|
40
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
41
|
+
*.manifest
|
|
42
|
+
*.spec
|
|
43
|
+
|
|
44
|
+
# Installer logs
|
|
45
|
+
pip-log.txt
|
|
46
|
+
pip-delete-this-directory.txt
|
|
47
|
+
|
|
48
|
+
# Unit test / coverage reports
|
|
49
|
+
htmlcov/
|
|
50
|
+
.tox/
|
|
51
|
+
.nox/
|
|
52
|
+
.coverage
|
|
53
|
+
.coverage.*
|
|
54
|
+
.cache
|
|
55
|
+
nosetests.xml
|
|
56
|
+
coverage.xml
|
|
57
|
+
*.cover
|
|
58
|
+
*.py.cover
|
|
59
|
+
.hypothesis/
|
|
60
|
+
.pytest_cache/
|
|
61
|
+
cover/
|
|
62
|
+
|
|
63
|
+
# Translations
|
|
64
|
+
*.mo
|
|
65
|
+
*.pot
|
|
66
|
+
|
|
67
|
+
# Django stuff:
|
|
68
|
+
*.log
|
|
69
|
+
local_settings.py
|
|
70
|
+
db.sqlite3
|
|
71
|
+
db.sqlite3-journal
|
|
72
|
+
|
|
73
|
+
# Flask stuff:
|
|
74
|
+
instance/
|
|
75
|
+
.webassets-cache
|
|
76
|
+
|
|
77
|
+
# Scrapy stuff:
|
|
78
|
+
.scrapy
|
|
79
|
+
|
|
80
|
+
# Sphinx documentation
|
|
81
|
+
docs/_build/
|
|
82
|
+
|
|
83
|
+
# PyBuilder
|
|
84
|
+
.pybuilder/
|
|
85
|
+
target/
|
|
86
|
+
|
|
87
|
+
# Jupyter Notebook
|
|
88
|
+
.ipynb_checkpoints
|
|
89
|
+
|
|
90
|
+
# IPython
|
|
91
|
+
profile_default/
|
|
92
|
+
ipython_config.py
|
|
93
|
+
|
|
94
|
+
# pyenv
|
|
95
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
96
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
97
|
+
# .python-version
|
|
98
|
+
|
|
99
|
+
# pipenv
|
|
100
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
101
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
102
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
103
|
+
# install all needed dependencies.
|
|
104
|
+
#Pipfile.lock
|
|
105
|
+
|
|
106
|
+
# UV
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
108
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
109
|
+
# commonly ignored for libraries.
|
|
110
|
+
#uv.lock
|
|
111
|
+
|
|
112
|
+
# poetry
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
114
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
115
|
+
# commonly ignored for libraries.
|
|
116
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
117
|
+
#poetry.lock
|
|
118
|
+
#poetry.toml
|
|
119
|
+
|
|
120
|
+
# pdm
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
122
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
123
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
124
|
+
#pdm.lock
|
|
125
|
+
#pdm.toml
|
|
126
|
+
.pdm-python
|
|
127
|
+
.pdm-build/
|
|
128
|
+
|
|
129
|
+
# pixi
|
|
130
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
131
|
+
#pixi.lock
|
|
132
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
133
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
134
|
+
.pixi
|
|
135
|
+
|
|
136
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
137
|
+
__pypackages__/
|
|
138
|
+
|
|
139
|
+
# Celery stuff
|
|
140
|
+
celerybeat-schedule
|
|
141
|
+
celerybeat.pid
|
|
142
|
+
|
|
143
|
+
# SageMath parsed files
|
|
144
|
+
*.sage.py
|
|
145
|
+
|
|
146
|
+
# Environments
|
|
147
|
+
.env
|
|
148
|
+
.envrc
|
|
149
|
+
.venv
|
|
150
|
+
env/
|
|
151
|
+
venv/
|
|
152
|
+
ENV/
|
|
153
|
+
env.bak/
|
|
154
|
+
venv.bak/
|
|
155
|
+
|
|
156
|
+
# Spyder project settings
|
|
157
|
+
.spyderproject
|
|
158
|
+
.spyproject
|
|
159
|
+
|
|
160
|
+
# Rope project settings
|
|
161
|
+
.ropeproject
|
|
162
|
+
|
|
163
|
+
# mkdocs documentation
|
|
164
|
+
/site
|
|
165
|
+
|
|
166
|
+
# mypy
|
|
167
|
+
.mypy_cache/
|
|
168
|
+
.dmypy.json
|
|
169
|
+
dmypy.json
|
|
170
|
+
|
|
171
|
+
# Pyre type checker
|
|
172
|
+
.pyre/
|
|
173
|
+
|
|
174
|
+
# pytype static type analyzer
|
|
175
|
+
.pytype/
|
|
176
|
+
|
|
177
|
+
# Cython debug symbols
|
|
178
|
+
cython_debug/
|
|
179
|
+
|
|
180
|
+
# PyCharm
|
|
181
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
182
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
183
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
184
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
185
|
+
#.idea/
|
|
186
|
+
|
|
187
|
+
# Abstra
|
|
188
|
+
# Abstra is an AI-powered process automation framework.
|
|
189
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
190
|
+
# Learn more at https://abstra.io/docs
|
|
191
|
+
.abstra/
|
|
192
|
+
|
|
193
|
+
# Visual Studio Code
|
|
194
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
195
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
196
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
197
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
198
|
+
# .vscode/
|
|
199
|
+
|
|
200
|
+
# Ruff stuff:
|
|
201
|
+
.ruff_cache/
|
|
202
|
+
|
|
203
|
+
# PyPI configuration file
|
|
204
|
+
.pypirc
|
|
205
|
+
|
|
206
|
+
# Cursor
|
|
207
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
208
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
209
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
210
|
+
.cursorignore
|
|
211
|
+
.cursorindexingignore
|
|
212
|
+
|
|
213
|
+
# Marimo
|
|
214
|
+
marimo/_static/
|
|
215
|
+
marimo/_lsp/
|
|
216
|
+
__marimo__/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Read the Docs configuration file
|
|
2
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
3
|
+
|
|
4
|
+
# Required
|
|
5
|
+
version: 2
|
|
6
|
+
|
|
7
|
+
# Set the OS, Python version, and other tools you might need
|
|
8
|
+
build:
|
|
9
|
+
os: ubuntu-24.04
|
|
10
|
+
tools:
|
|
11
|
+
python: "3.12"
|
|
12
|
+
|
|
13
|
+
# Install dependencies with uv
|
|
14
|
+
python:
|
|
15
|
+
install:
|
|
16
|
+
- method: uv
|
|
17
|
+
command: sync
|
|
18
|
+
groups:
|
|
19
|
+
- dev
|
|
20
|
+
|
|
21
|
+
# Build documentation in the "docs/" directory with Sphinx
|
|
22
|
+
sphinx:
|
|
23
|
+
configuration: docs/source/conf.py
|
|
24
|
+
fail_on_warning: true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Team Diary Guidelines
|
|
2
|
+
|
|
3
|
+
Write here information that you might think is relevant for your colleagues to know about. Do so as you personally prefer; bullet points are fine, summarized versions are fine, no pressure. You may leave spots empty as you please. This is meant for us, the bar is low. You may edit the format if you feel like it needs improvement
|
|
4
|
+
|
|
5
|
+
Format:
|
|
6
|
+
```
|
|
7
|
+
## DD-MM-YYYY
|
|
8
|
+
|
|
9
|
+
### Worked On
|
|
10
|
+
|
|
11
|
+
### Learned
|
|
12
|
+
|
|
13
|
+
### Problems
|
|
14
|
+
|
|
15
|
+
### Next
|
|
16
|
+
|
|
17
|
+
## DD-MM-YYYY
|
|
18
|
+
|
|
19
|
+
### Worked On
|
|
20
|
+
.....
|
|
21
|
+
```
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# Chart Storage Strategy
|
|
2
|
+
|
|
3
|
+
# Design Principles
|
|
4
|
+
|
|
5
|
+
The pipeline produces multiple layers of information:
|
|
6
|
+
|
|
7
|
+
* Extracted image metadata
|
|
8
|
+
* OCR output
|
|
9
|
+
* VLM output
|
|
10
|
+
* Raw model responses
|
|
11
|
+
* Structured chart data
|
|
12
|
+
|
|
13
|
+
These serve different purposes and should not all be stored in the same format.
|
|
14
|
+
|
|
15
|
+
The recommended approach is:
|
|
16
|
+
|
|
17
|
+
1. Preserve the complete extraction artifact as raw JSON.
|
|
18
|
+
2. Create normalized analytical tables for querying.
|
|
19
|
+
3. Store analytical tables in Parquet format.
|
|
20
|
+
4. Query analytical tables using DuckDB.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Storage Layers
|
|
25
|
+
|
|
26
|
+
## Layer 1: Raw Extraction Archive
|
|
27
|
+
|
|
28
|
+
Store the complete extraction output exactly as produced by the pipeline.
|
|
29
|
+
|
|
30
|
+
Example:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"chart_id": "b219ad15-c988-4459-9942-52ad814e71d4",
|
|
35
|
+
"pdf_id": "4974d4ed-4c99-4336-aa3b-18bd1acd9ffc",
|
|
36
|
+
"page_number": 6,
|
|
37
|
+
"image_path": "temp/extracted_images/b219ad15-c988-4459-9942-52ad814e71d4.png",
|
|
38
|
+
"ocr": {...},
|
|
39
|
+
"vlm": {...},
|
|
40
|
+
"metadata": {...}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Recommended format:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
raw/
|
|
48
|
+
chart_runs.jsonl
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
One JSON object per extracted chart.
|
|
52
|
+
|
|
53
|
+
### Benefits
|
|
54
|
+
|
|
55
|
+
* Full reproducibility
|
|
56
|
+
* Preserves original OCR output
|
|
57
|
+
* Preserves original model responses
|
|
58
|
+
* Allows future reprocessing without rerunning models
|
|
59
|
+
* Supports auditing and debugging
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# Layer 2: Analytical Tables
|
|
64
|
+
|
|
65
|
+
Flatten extracted chart data into normalized tables.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Table: charts
|
|
70
|
+
|
|
71
|
+
One row per chart.
|
|
72
|
+
|
|
73
|
+
| Column | Description |
|
|
74
|
+
| -------------------- | ----------------------------- |
|
|
75
|
+
| chart_id | Unique chart identifier |
|
|
76
|
+
| pdf_id | Source PDF |
|
|
77
|
+
| page_number | Page number |
|
|
78
|
+
| image_path | Extracted image path |
|
|
79
|
+
| chart_type | Bar, line, scatter, pie, etc. |
|
|
80
|
+
| confidence | Model confidence |
|
|
81
|
+
| model | VLM model used |
|
|
82
|
+
| extraction_timestamp | Extraction time |
|
|
83
|
+
| pipeline_version | Pipeline version |
|
|
84
|
+
|
|
85
|
+
Example:
|
|
86
|
+
|
|
87
|
+
| chart_id | chart_type |
|
|
88
|
+
| -------- | ----------------- |
|
|
89
|
+
| abc123 | line_chart |
|
|
90
|
+
| def456 | grouped_bar_chart |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Table: series
|
|
95
|
+
|
|
96
|
+
One row per chart series.
|
|
97
|
+
|
|
98
|
+
| Column | Description |
|
|
99
|
+
| ------------ | ------------------------ |
|
|
100
|
+
| series_id | Unique series identifier |
|
|
101
|
+
| chart_id | Parent chart |
|
|
102
|
+
| series_index | Position in chart |
|
|
103
|
+
| series_name | Series label |
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
| series_id | chart_id | series_name |
|
|
108
|
+
| --------- | -------- | ---------------- |
|
|
109
|
+
| 1 | def456 | BOJ Holdings |
|
|
110
|
+
| 2 | def456 | Outstanding JGBs |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Table: points
|
|
115
|
+
|
|
116
|
+
One row per data point.
|
|
117
|
+
|
|
118
|
+
| Column | Description |
|
|
119
|
+
| ----------- | ----------------------------------- |
|
|
120
|
+
| point_id | Unique point identifier |
|
|
121
|
+
| chart_id | Parent chart |
|
|
122
|
+
| series_id | Parent series |
|
|
123
|
+
| point_index | Position within series |
|
|
124
|
+
| x_raw | Original x-axis value |
|
|
125
|
+
| x_numeric | Numeric representation if available |
|
|
126
|
+
| x_type | year, category, date, numeric |
|
|
127
|
+
| y | Y value |
|
|
128
|
+
| y_unit | %, USD, count, etc. |
|
|
129
|
+
|
|
130
|
+
Example:
|
|
131
|
+
|
|
132
|
+
| chart_id | series_name | x_raw | y |
|
|
133
|
+
| -------- | ------------ | ----- | -- |
|
|
134
|
+
| def456 | BOJ Holdings | 2000 | 1 |
|
|
135
|
+
| def456 | BOJ Holdings | 2010 | 5 |
|
|
136
|
+
| def456 | BOJ Holdings | 2017 | 46 |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
# Recommended File Formats
|
|
141
|
+
|
|
142
|
+
## Raw Data
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
JSONL
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Reason:
|
|
149
|
+
|
|
150
|
+
* Human-readable
|
|
151
|
+
* Easy debugging
|
|
152
|
+
* Supports append-only workflows
|
|
153
|
+
* Preserves full extraction context
|
|
154
|
+
|
|
155
|
+
Directory:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
raw/chart_runs.jsonl
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Analytical Data
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
Parquet
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Reason:
|
|
170
|
+
|
|
171
|
+
* Columnar storage
|
|
172
|
+
* Compression
|
|
173
|
+
* Fast analytical queries
|
|
174
|
+
* Compatible with DuckDB, Pandas, Polars, Spark, BigQuery
|
|
175
|
+
|
|
176
|
+
Directory:
|
|
177
|
+
|
|
178
|
+
```text
|
|
179
|
+
tables/
|
|
180
|
+
charts.parquet
|
|
181
|
+
series.parquet
|
|
182
|
+
points.parquet
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
# Query Layer
|
|
188
|
+
|
|
189
|
+
Use DuckDB as the primary query engine.
|
|
190
|
+
|
|
191
|
+
Example:
|
|
192
|
+
|
|
193
|
+
```sql
|
|
194
|
+
SELECT chart_type,
|
|
195
|
+
COUNT(*)
|
|
196
|
+
FROM charts
|
|
197
|
+
GROUP BY chart_type;
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Example:
|
|
201
|
+
|
|
202
|
+
```sql
|
|
203
|
+
SELECT p.x_raw,
|
|
204
|
+
p.y
|
|
205
|
+
FROM points p
|
|
206
|
+
JOIN series s
|
|
207
|
+
ON p.series_id = s.series_id
|
|
208
|
+
WHERE s.series_name = 'Outstanding JGBs';
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Example:
|
|
212
|
+
|
|
213
|
+
```sql
|
|
214
|
+
SELECT AVG(y)
|
|
215
|
+
FROM points
|
|
216
|
+
WHERE chart_id = 'def456';
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
# Directory Structure
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
data/
|
|
225
|
+
|
|
226
|
+
├── raw/
|
|
227
|
+
│ └── chart_runs.jsonl
|
|
228
|
+
│
|
|
229
|
+
├── tables/
|
|
230
|
+
│ ├── charts.parquet
|
|
231
|
+
│ ├── series.parquet
|
|
232
|
+
│ └── points.parquet
|
|
233
|
+
│
|
|
234
|
+
├── images/
|
|
235
|
+
│ └── extracted_chart_images/
|
|
236
|
+
│
|
|
237
|
+
└── metadata/
|
|
238
|
+
└── extraction_runs.json
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
# Future Extensions
|
|
244
|
+
|
|
245
|
+
The schema can be expanded to include:
|
|
246
|
+
|
|
247
|
+
## OCR Labels Table
|
|
248
|
+
|
|
249
|
+
```text
|
|
250
|
+
ocr_labels
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Stores:
|
|
254
|
+
|
|
255
|
+
* OCR text
|
|
256
|
+
* Bounding boxes
|
|
257
|
+
* OCR confidence
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Classification Table
|
|
262
|
+
|
|
263
|
+
```text
|
|
264
|
+
classifications
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Stores:
|
|
268
|
+
|
|
269
|
+
* Chart classifier outputs
|
|
270
|
+
* Model confidence
|
|
271
|
+
* Predicted chart categories
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Provenance Table
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
provenance
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Stores:
|
|
282
|
+
|
|
283
|
+
* Source PDF
|
|
284
|
+
* Page number
|
|
285
|
+
* Extraction timestamp
|
|
286
|
+
* Model versions
|
|
287
|
+
* Pipeline versions
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
# Final Recommendation
|
|
292
|
+
|
|
293
|
+
Use a dual-storage architecture:
|
|
294
|
+
|
|
295
|
+
### Reproducibility Layer
|
|
296
|
+
|
|
297
|
+
Store complete extraction artifacts as:
|
|
298
|
+
|
|
299
|
+
```text
|
|
300
|
+
JSONL
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Analytics Layer
|
|
304
|
+
|
|
305
|
+
Store normalized tables as:
|
|
306
|
+
|
|
307
|
+
```text
|
|
308
|
+
Parquet
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Query analytical data using:
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
DuckDB
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
This provides:
|
|
318
|
+
|
|
319
|
+
* Full reproducibility
|
|
320
|
+
* Efficient storage
|
|
321
|
+
* Fast SQL querying
|
|
322
|
+
* Easy scaling
|
|
323
|
+
* Compatibility with future data platforms
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Team Diary Guidelines
|
|
2
|
+
|
|
3
|
+
Write here information that you might think is relevant for your colleagues to know about. Do so as you personally prefer; bullet points are fine, summarized versions are fine, no pressure. You may leave spots empty as you please. This is meant for us, the bar is low. You may edit the format if you feel like it needs improvement
|
|
4
|
+
|
|
5
|
+
Format:
|
|
6
|
+
```
|
|
7
|
+
## DD-MM-YYYY
|
|
8
|
+
|
|
9
|
+
### Worked On
|
|
10
|
+
|
|
11
|
+
### Learned
|
|
12
|
+
|
|
13
|
+
### Problems
|
|
14
|
+
|
|
15
|
+
### Next
|
|
16
|
+
|
|
17
|
+
## DD-MM-YYYY
|
|
18
|
+
|
|
19
|
+
### Worked On
|
|
20
|
+
.....
|
|
21
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Team Diary Guidelines
|
|
2
|
+
|
|
3
|
+
Write here information that you might think is relevant for your colleagues to know about. Do so as you personally prefer; bullet points are fine, summarized versions are fine, no pressure. You may leave spots empty as you please. This is meant for us, the bar is low. You may edit the format if you feel like it needs improvement
|
|
4
|
+
|
|
5
|
+
Format:
|
|
6
|
+
```
|
|
7
|
+
## DD-MM-YYYY
|
|
8
|
+
|
|
9
|
+
### Worked On
|
|
10
|
+
|
|
11
|
+
### Learned
|
|
12
|
+
|
|
13
|
+
### Problems
|
|
14
|
+
|
|
15
|
+
### Next
|
|
16
|
+
|
|
17
|
+
## DD-MM-YYYY
|
|
18
|
+
|
|
19
|
+
### Worked On
|
|
20
|
+
.....
|
|
21
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Team Diary Guidelines
|
|
2
|
+
|
|
3
|
+
Write here information that you might think is relevant for your colleagues to know about. Do so as you personally prefer; bullet points are fine, summarized versions are fine, no pressure. You may leave spots empty as you please. This is meant for us, the bar is low. You may edit the format if you feel like it needs improvement
|
|
4
|
+
|
|
5
|
+
Format:
|
|
6
|
+
```
|
|
7
|
+
## DD-MM-YYYY
|
|
8
|
+
|
|
9
|
+
### Worked On
|
|
10
|
+
|
|
11
|
+
### Learned
|
|
12
|
+
|
|
13
|
+
### Problems
|
|
14
|
+
|
|
15
|
+
### Next
|
|
16
|
+
|
|
17
|
+
## DD-MM-YYYY
|
|
18
|
+
|
|
19
|
+
### Worked On
|
|
20
|
+
.....
|
|
21
|
+
```
|