indico_toolkit 2.0.2__tar.gz → 6.0.1__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.
- indico_toolkit-6.0.1/.github/workflows/build.yml +64 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/CHANGELOG.md +30 -7
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/PKG-INFO +24 -16
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/README.md +22 -15
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/auto_review_predictions.py +20 -13
- indico_toolkit-6.0.1/examples/copy_teach_task.py +20 -0
- indico_toolkit-6.0.1/examples/create_auto_classification_workflow.py +28 -0
- indico_toolkit-6.0.1/examples/create_full_structure.py +44 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/dataset_tasks.py +0 -12
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/pdf_highlighter.py +0 -1
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/__init__.py +1 -1
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/positioning.py +33 -0
- indico_toolkit-6.0.1/indico_toolkit/auto_populate/__init__.py +1 -0
- indico_toolkit-6.0.1/indico_toolkit/auto_populate/populator.py +344 -0
- indico_toolkit-6.0.1/indico_toolkit/auto_populate/types.py +58 -0
- indico_toolkit-6.0.1/indico_toolkit/auto_review/__init__.py +1 -0
- indico_toolkit-6.0.1/indico_toolkit/auto_review/auto_reviewer.py +63 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/errors.py +8 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/__init__.py +1 -1
- indico_toolkit-6.0.1/indico_toolkit/indico_wrapper/dataset.py +96 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/download.py +58 -7
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/workflow.py +3 -6
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/metrics/metrics.py +126 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/ocr/ondoc_object.py +1 -1
- indico_toolkit-6.0.1/indico_toolkit/staggered_loop/__init__.py +2 -0
- indico_toolkit-6.0.1/indico_toolkit/staggered_loop/queries.py +42 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/staggered_loop/staggered_loop.py +39 -16
- indico_toolkit-6.0.1/indico_toolkit/staggered_loop/staggered_loop_recruiter.py +180 -0
- indico_toolkit-6.0.1/indico_toolkit/structure/create_structure.py +226 -0
- indico_toolkit-6.0.1/indico_toolkit/structure/queries.py +98 -0
- indico_toolkit-6.0.1/indico_toolkit/structure/utils.py +12 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/types/workflow_object.py +37 -8
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/pyproject.toml +1 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/requirements.txt +0 -1
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/setup.py +2 -2
- indico_toolkit-6.0.1/tests/association/data/token_page/tokens.json +110 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/test_positioning.py +43 -1
- indico_toolkit-6.0.1/tests/auto_populate/test_populator.py +78 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/auto_review/test_auto_review.py +64 -27
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/conftest.py +74 -85
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/auto_review/preds.json +2 -2
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/samples/fin_disc_snapshot.csv +103 -103
- indico_toolkit-6.0.1/tests/data/samples/staggered_loop_recruiter_example.json +103 -0
- indico_toolkit-6.0.1/tests/data/snapshots/populator_snapshot.csv +17723 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/test_dataset.py +3 -11
- indico_toolkit-6.0.1/tests/indico_wrapper/test_download.py +37 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/test_workflow.py +1 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/staggered_loop/test_staggered_loop.py +1 -1
- indico_toolkit-6.0.1/tests/staggered_loop/test_staggered_loop_recruiter.py +24 -0
- indico_toolkit-6.0.1/tests/structure/test_create_structure.py +2 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/conftest.py +2 -2
- indico_toolkit-2.0.2/.github/workflows/build.yml +0 -38
- indico_toolkit-2.0.2/docs/doctrees/environment.pickle +0 -0
- indico_toolkit-2.0.2/docs/doctrees/index.doctree +0 -0
- indico_toolkit-2.0.2/docs/doctrees/modules.doctree +0 -0
- indico_toolkit-2.0.2/docs/doctrees/row_association.doctree +0 -0
- indico_toolkit-2.0.2/docs/doctrees/solutions_toolkit.doctree +0 -0
- indico_toolkit-2.0.2/docs/doctrees/solutions_toolkit.row_association.doctree +0 -0
- indico_toolkit-2.0.2/docs/html/.buildinfo +0 -4
- indico_toolkit-2.0.2/docs/html/_sources/index.rst.txt +0 -26
- indico_toolkit-2.0.2/docs/html/_sources/modules.rst.txt +0 -7
- indico_toolkit-2.0.2/docs/html/_sources/row_association.rst.txt +0 -18
- indico_toolkit-2.0.2/docs/html/_sources/solutions_toolkit.row_association.rst.txt +0 -29
- indico_toolkit-2.0.2/docs/html/_sources/solutions_toolkit.rst.txt +0 -18
- indico_toolkit-2.0.2/docs/html/_static/basic.css +0 -856
- indico_toolkit-2.0.2/docs/html/_static/css/badge_only.css +0 -1
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-bold.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-bold.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-normal.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/fonts/lato-normal.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/css/indicotheme.css +0 -54
- indico_toolkit-2.0.2/docs/html/_static/css/theme.css +0 -4
- indico_toolkit-2.0.2/docs/html/_static/doctools.js +0 -321
- indico_toolkit-2.0.2/docs/html/_static/documentation_options.js +0 -12
- indico_toolkit-2.0.2/docs/html/_static/favicon.png +0 -0
- indico_toolkit-2.0.2/docs/html/_static/file.png +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Inconsolata-Bold.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Inconsolata-Regular.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Inconsolata.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bold.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bold.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-italic.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-italic.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-regular.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-regular.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato-Bold.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/Lato-Regular.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab-Bold.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/RobotoSlab-Regular.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/fontawesome-webfont.eot +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/fontawesome-webfont.svg +0 -2671
- indico_toolkit-2.0.2/docs/html/_static/fonts/fontawesome-webfont.ttf +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/fontawesome-webfont.woff +0 -0
- indico_toolkit-2.0.2/docs/html/_static/fonts/fontawesome-webfont.woff2 +0 -0
- indico_toolkit-2.0.2/docs/html/_static/jquery-3.5.1.js +0 -10872
- indico_toolkit-2.0.2/docs/html/_static/jquery.js +0 -2
- indico_toolkit-2.0.2/docs/html/_static/js/badge_only.js +0 -1
- indico_toolkit-2.0.2/docs/html/_static/js/html5shiv-printshiv.min.js +0 -4
- indico_toolkit-2.0.2/docs/html/_static/js/html5shiv.min.js +0 -4
- indico_toolkit-2.0.2/docs/html/_static/js/modernizr.min.js +0 -4
- indico_toolkit-2.0.2/docs/html/_static/js/theme.js +0 -1
- indico_toolkit-2.0.2/docs/html/_static/language_data.js +0 -297
- indico_toolkit-2.0.2/docs/html/_static/logo-white.png +0 -0
- indico_toolkit-2.0.2/docs/html/_static/minus.png +0 -0
- indico_toolkit-2.0.2/docs/html/_static/plus.png +0 -0
- indico_toolkit-2.0.2/docs/html/_static/pygments.css +0 -74
- indico_toolkit-2.0.2/docs/html/_static/searchtools.js +0 -522
- indico_toolkit-2.0.2/docs/html/_static/underscore-1.12.0.js +0 -2027
- indico_toolkit-2.0.2/docs/html/_static/underscore.js +0 -6
- indico_toolkit-2.0.2/docs/html/genindex.html +0 -302
- indico_toolkit-2.0.2/docs/html/index.html +0 -234
- indico_toolkit-2.0.2/docs/html/modules.html +0 -216
- indico_toolkit-2.0.2/docs/html/objects.inv +0 -5
- indico_toolkit-2.0.2/docs/html/py-modindex.html +0 -231
- indico_toolkit-2.0.2/docs/html/row_association.html +0 -323
- indico_toolkit-2.0.2/docs/html/search.html +0 -221
- indico_toolkit-2.0.2/docs/html/searchindex.js +0 -1
- indico_toolkit-2.0.2/docs/html/solutions_toolkit.html +0 -224
- indico_toolkit-2.0.2/docs/html/solutions_toolkit.row_association.html +0 -321
- indico_toolkit-2.0.2/docsrc/Makefile +0 -20
- indico_toolkit-2.0.2/docsrc/_static/css/indicotheme.css +0 -54
- indico_toolkit-2.0.2/docsrc/_static/favicon.png +0 -0
- indico_toolkit-2.0.2/docsrc/_static/logo-white.png +0 -0
- indico_toolkit-2.0.2/docsrc/conf.py +0 -62
- indico_toolkit-2.0.2/docsrc/index.rst +0 -26
- indico_toolkit-2.0.2/docsrc/make.bat +0 -35
- indico_toolkit-2.0.2/docsrc/modules.rst +0 -7
- indico_toolkit-2.0.2/docsrc/row_association.rst +0 -18
- indico_toolkit-2.0.2/examples/auto_classifier.py +0 -44
- indico_toolkit-2.0.2/examples/partial_labels.py +0 -149
- indico_toolkit-2.0.2/examples/staggered_loop.py +0 -15
- indico_toolkit-2.0.2/indico_toolkit/auto_class/__init__.py +0 -1
- indico_toolkit-2.0.2/indico_toolkit/auto_class/classifier.py +0 -171
- indico_toolkit-2.0.2/indico_toolkit/auto_review/__init__.py +0 -2
- indico_toolkit-2.0.2/indico_toolkit/auto_review/auto_reviewer.py +0 -70
- indico_toolkit-2.0.2/indico_toolkit/auto_review/review_config.py +0 -37
- indico_toolkit-2.0.2/indico_toolkit/indico_wrapper/dataset.py +0 -207
- indico_toolkit-2.0.2/indico_toolkit/staggered_loop/__init__.py +0 -1
- indico_toolkit-2.0.2/tests/auto_class/test_auto_classifier.py +0 -55
- indico_toolkit-2.0.2/tests/auto_class/test_page_classifier.py +0 -42
- indico_toolkit-2.0.2/tests/data/auto_review/field_config.json +0 -55
- indico_toolkit-2.0.2/tests/indico_wrapper/test_download.py +0 -26
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/.gitignore +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/LICENSE +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/ground_truth_metrics.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/manipulate_pdfs.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/merge_snapshots.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/model_metrics.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/row_association.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/submitting_to_doc_extraction.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/examples/submitting_to_workflow.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/association.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/extracted_tokens.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/line_items.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/association/split_merged_values.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/auto_review/auto_review_functions.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/client.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/highlighter/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/highlighter/highlighter.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/doc_extraction.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/indico_wrapper.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/indico_wrapper/reviewer.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/metrics/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/metrics/compare_ground_truth.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/metrics/compare_models.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/metrics/plotting.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/ocr/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/ocr/customocr_object.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/ocr/standard_object.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/pipelines/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/pipelines/file_processing.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/pipelines/pdf_manipulation.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/retry.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/snapshots/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/snapshots/snapshot.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/staggered_loop/metrics.py +0 -0
- {indico_toolkit-2.0.2/tests → indico_toolkit-6.0.1/indico_toolkit/structure}/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/types/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/types/classification.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/types/extractions.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/indico_toolkit/types/predictions.py +0 -0
- {indico_toolkit-2.0.2/tests/association → indico_toolkit-6.0.1/tests}/__init__.py +0 -0
- {indico_toolkit-2.0.2/tests/auto_class → indico_toolkit-6.0.1/tests/association}/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/conftest.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/data/three_row_invoice/preds.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/data/three_row_invoice/tokens.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/data/two_row_bank_statement/preds.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/data/two_row_bank_statement/tokens.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/test_extracted_tokens.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/test_line_items.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/association/test_split_merged_values.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/auto_review/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/auto_class/class_a/sample_two_pages.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/auto_class/class_b/inv_sample2.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/samples/fin_disc.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/samples/fin_disc_classification.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/samples/fin_disc_result.json +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/snapshots/snapshot.csv +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/data/snapshots/updated_snapshot.csv +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/fcc_doc.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/fcc_ocr_obj.p +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/fcc_predictions.p +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/highlighted_fcc.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/highlighted_invoice.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/invoice_sample.pdf +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/ocr_obj.p +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/data/predictions.p +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/highlighter/test_highlighter.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/test_doc_extraction.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/test_indico_wrapper.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/indico_wrapper/test_reviewer.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/integration/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/integration/test_processing_pdfs.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/integration/test_snapshot_upload.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/integration/test_workflow_rows.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/metrics/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/metrics/test_compare_ground_truth.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/metrics/test_compare_models.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/metrics/test_metrics.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/metrics/test_plotting.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/ocr/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/ocr/test_customocr_object.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/ocr/test_ondoc_object.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/ocr/test_standard_object.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/pipelines/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/pipelines/test_file_processing.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/pipelines/test_pdf_manipulation.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/pytest.ini +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/snapshots/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/snapshots/conftest.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/snapshots/test_snapshot.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/staggered_loop/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/test_create_client.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/test_retry.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/__init__.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/test_classifications.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/test_extractions.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/test_predictions.py +0 -0
- {indico_toolkit-2.0.2 → indico_toolkit-6.0.1}/tests/types/test_worflow_result.py +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
on: [push]
|
|
3
|
+
jobs:
|
|
4
|
+
build:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
strategy:
|
|
7
|
+
matrix:
|
|
8
|
+
python-version: [3.7]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
API_TOKEN: ${{ secrets.TEST_API_TOKEN }}
|
|
12
|
+
DATASET_ID: ${{ secrets.DATASET_ID }}
|
|
13
|
+
PDF_DATASET_ID: ${{ secrets.PDF_DATASET_ID }}
|
|
14
|
+
MODEL_NAME: ${{ secrets.MODEL_NAME }}
|
|
15
|
+
WORKFLOW_ID: ${{ secrets.WORKFLOW_ID }}
|
|
16
|
+
MODEL_ID: ${{ secrets.MODEL_ID }}
|
|
17
|
+
MODEL_GROUP_ID: ${{ secrets.MODEL_GROUP_ID }}
|
|
18
|
+
TEACH_TASK_ID: ${{ secrets.TEACH_TASK_ID }}
|
|
19
|
+
HOST_URL: try.indico.io
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout sources
|
|
23
|
+
uses: actions/checkout@v2
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v2
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
python -m pip install -r requirements.txt
|
|
34
|
+
python -m pip install -e .[full]
|
|
35
|
+
python -m pip install flake8 pytest pytest-cov
|
|
36
|
+
|
|
37
|
+
- name: Run formatter
|
|
38
|
+
run: |
|
|
39
|
+
black indico_toolkit
|
|
40
|
+
|
|
41
|
+
- name: Run tests and build coverage file
|
|
42
|
+
run: |
|
|
43
|
+
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=indico_toolkit tests/ | tee pytest-coverage.txt
|
|
44
|
+
|
|
45
|
+
- name: Pytest coverage comment
|
|
46
|
+
id: coverageComment
|
|
47
|
+
uses: MishaKav/pytest-coverage-comment@main
|
|
48
|
+
with:
|
|
49
|
+
pytest-coverage-path: ./pytest-coverage.txt
|
|
50
|
+
junitxml-path: ./pytest.xml
|
|
51
|
+
title: Indico Toolkit Coverage Report
|
|
52
|
+
badge-title: Test Coverage
|
|
53
|
+
default-branch: main
|
|
54
|
+
|
|
55
|
+
- name: Check the output coverage
|
|
56
|
+
run: |
|
|
57
|
+
echo "Coverage Percantage - ${{ steps.coverageComment.outputs.coverage }}"
|
|
58
|
+
echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}"
|
|
59
|
+
echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}"
|
|
60
|
+
echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}"
|
|
61
|
+
echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}"
|
|
62
|
+
echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}"
|
|
63
|
+
echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}"
|
|
64
|
+
echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}"
|
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
## 1.0.1 - 6/2/2021
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
|
+
|
|
6
7
|
* Added Snapshot merging / manipulation
|
|
7
8
|
* Class for highlighting extractions onto source PDFs and adding table of contents.
|
|
8
9
|
|
|
9
10
|
### Fixed
|
|
11
|
+
|
|
10
12
|
* Row Association now also sorting on 'bbtop'
|
|
11
13
|
|
|
12
14
|
## 1.0.2 6/15/2021
|
|
13
15
|
|
|
14
16
|
### Added
|
|
17
|
+
|
|
15
18
|
* PDF manipulation features
|
|
16
19
|
* Support for classification predictions
|
|
17
20
|
|
|
18
21
|
### Fixed
|
|
19
|
-
* Dependency installation
|
|
20
22
|
|
|
23
|
+
* Dependency installation
|
|
21
24
|
|
|
22
25
|
## 1.0.3 8/16/2021
|
|
23
26
|
|
|
24
27
|
### Added
|
|
28
|
+
|
|
25
29
|
* Find from questionnaire ID added to finder class.
|
|
26
30
|
* ModelGroupPredict support added.
|
|
27
31
|
* Added module to get metrics for all models in a group.
|
|
@@ -31,18 +35,21 @@
|
|
|
31
35
|
* Added additional snapshot features.
|
|
32
36
|
|
|
33
37
|
### Fixed
|
|
38
|
+
|
|
34
39
|
* Wait kwarg added to submit review method.
|
|
35
40
|
* Better support for dataset creation / adding files to teach tasks.
|
|
36
41
|
|
|
37
42
|
## 1.0.5 9/21/2021
|
|
38
43
|
|
|
39
44
|
### Added
|
|
45
|
+
|
|
40
46
|
* Classes for model comparison and model improvement.
|
|
41
47
|
* Plotting functionality for model comparison.
|
|
42
48
|
|
|
43
49
|
## 1.0.7 11/9/2021
|
|
44
50
|
|
|
45
51
|
### Added
|
|
52
|
+
|
|
46
53
|
* Positioning class added to assist in relative prediction location validation
|
|
47
54
|
* Added # of samples labeled to metrics class.
|
|
48
55
|
|
|
@@ -53,6 +60,7 @@
|
|
|
53
60
|
## 1.0.8 11/15/2021
|
|
54
61
|
|
|
55
62
|
### Added
|
|
63
|
+
|
|
56
64
|
* New line plot for number of samples in metrics class.
|
|
57
65
|
* Update to highlighting class with new flexibility and bookmarks replacing table of contents.
|
|
58
66
|
|
|
@@ -74,9 +82,9 @@
|
|
|
74
82
|
### Added
|
|
75
83
|
|
|
76
84
|
* New distance measurements in the prediction Positioning class.
|
|
77
|
-
* New Features on the Extractions class: predictions that are removed by any method are saved in an
|
|
78
|
-
attribute if they're needed for logs, etc.; get all text values for a particular label; get most
|
|
79
|
-
common text value for a particular label.
|
|
85
|
+
* New Features on the Extractions class: predictions that are removed by any method are saved in an
|
|
86
|
+
attribute if they're needed for logs, etc.; get all text values for a particular label; get most
|
|
87
|
+
common text value for a particular label.
|
|
80
88
|
* Better exception handling for Workflow submissions and more flexibility on format of what is returned
|
|
81
89
|
(allows custom response jsons to avoid the WorkflowResult class).
|
|
82
90
|
|
|
@@ -87,7 +95,8 @@
|
|
|
87
95
|
* Updated metrics plot to order ascending based on latest model
|
|
88
96
|
* New feature in Positioning class to calculate overlap between two bounding boxes on the same page
|
|
89
97
|
|
|
90
|
-
### Fixed
|
|
98
|
+
### Fixed
|
|
99
|
+
|
|
91
100
|
* Optional dependencies to support M1 installation
|
|
92
101
|
|
|
93
102
|
## 2.0.1 5/20/2022
|
|
@@ -114,6 +123,20 @@
|
|
|
114
123
|
* Updates Snapshot class to account for updated target spans
|
|
115
124
|
* Updates Add Model calls to aligh with 5.1.4 components
|
|
116
125
|
|
|
117
|
-
|
|
126
|
+
## 6.0 10/30/23
|
|
127
|
+
|
|
128
|
+
This is the first major version release tested to work on Indico 6.X.
|
|
129
|
+
|
|
130
|
+
### Added
|
|
131
|
+
|
|
132
|
+
* Refactored AutoReview to simplify setup.
|
|
133
|
+
* Replaced AutoClassifier with AutoPopulator to make ondoc classification model training simple. This class also includes a "copy_teach_task" method that is a frequently needed standalone method.
|
|
134
|
+
* Simplified a StaggeredLoop implementation to inject labeled samples into a dev workflow (deprecated previous version).
|
|
135
|
+
* Added support for unbundling metrics.
|
|
136
|
+
* Added the `Strucure` class to support building out workflows, datasets, teach tasks. As well as to support copying workflows.
|
|
137
|
+
|
|
138
|
+
## 6.0.1 11/22/23
|
|
139
|
+
|
|
140
|
+
### Added
|
|
118
141
|
|
|
119
|
-
*
|
|
142
|
+
* Small but important fix to add original filename to the workflow result object
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: indico_toolkit
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: A package to support Indico IPA development
|
|
5
5
|
Home-page: https://github.com/IndicoDataSolutions/Indico-Solutions-Toolkit
|
|
6
6
|
Author: indico
|
|
@@ -11,6 +11,7 @@ Requires-Dist: indico-client>=5.1.4
|
|
|
11
11
|
Requires-Dist: plotly==5.2.1
|
|
12
12
|
Requires-Dist: tqdm==4.50.0
|
|
13
13
|
Requires-Dist: faker==13.3.3
|
|
14
|
+
Requires-Dist: python-dateutil==2.8.1
|
|
14
15
|
Requires-Dist: PyMuPDF==1.19.6 ; extra == "full"
|
|
15
16
|
Requires-Dist: spacy>=3.1.4,<4 ; extra == "full"
|
|
16
17
|
Requires-Dist: pytest>=5.2.1 ; extra == "test"
|
|
@@ -19,53 +20,60 @@ Requires-Dist: pytest-dependency==0.5.1 ; extra == "test"
|
|
|
19
20
|
Provides-Extra: full
|
|
20
21
|
Provides-Extra: test
|
|
21
22
|
|
|
22
|
-
|
|
23
23
|
# Indico-Toolkit
|
|
24
|
+
|
|
24
25
|
A library to assist Indico IPA development
|
|
25
26
|
|
|
26
27
|
### Available Functionality
|
|
28
|
+
|
|
27
29
|
The indico-toolkit provides classes and functions to help achieve the following:
|
|
30
|
+
|
|
28
31
|
* Easy batch workflow submission and retrieval.
|
|
29
32
|
* Classes that simplify dataset/doc-extraction functionality.
|
|
30
33
|
* Tools to assist with positioning, e.g. row association, distance between preds, relative position validation.
|
|
34
|
+
* Tools to assist with creating and copying workflow structures.
|
|
31
35
|
* Get metrics for all model IDs in a model group to see how well fields are performing after more labeling.
|
|
32
36
|
* Compare two models via bar plot and data tables.
|
|
33
37
|
* Highlighting extraction predictions on source PDFs.
|
|
34
|
-
* Staggered loop
|
|
38
|
+
* A simple Staggered loop implementation to identify high error documents and inject reviewed results into dev tasks.
|
|
35
39
|
* Train a document classification model without labeling.
|
|
36
|
-
*
|
|
37
|
-
* Helpful Scripted/Auto Review processing and submission.
|
|
40
|
+
* An AutoReview class to assist with automated acceptance/rejection of model predictions.
|
|
38
41
|
* Common manipulation of prediction/workflow results.
|
|
39
42
|
* Objects to simplify parsing OCR responses.
|
|
40
43
|
* Snapshot merging and manipulation
|
|
41
|
-
* Class to spoof a human reviewer.
|
|
42
44
|
|
|
43
45
|
### Installation
|
|
46
|
+
|
|
44
47
|
```
|
|
45
48
|
pip install indico_toolkit
|
|
46
49
|
```
|
|
50
|
+
|
|
51
|
+
* Note: if you are on Indico 6.X, install an indico_toolkit 6.X version. If you're on 5.X install a 2.X version.
|
|
47
52
|
* Note: If you are on a version of the Indico IPA platform pre-5.1, then install indico-toolkit==1.2.3.
|
|
48
53
|
* If you want to use PdfHighlighter, install with `pip install 'indico_toolkit[full]'` as PyMuPDF is an optional dependency.
|
|
49
54
|
|
|
50
55
|
### Example Useage
|
|
51
|
-
|
|
56
|
+
|
|
57
|
+
For scripted examples on how to use the toolkit, see the [examples directory](https://github.com/IndicoDataSolutions/Indico-Solutions-Toolkit/tree/main/examples)
|
|
52
58
|
|
|
53
59
|
### Tests
|
|
60
|
+
|
|
54
61
|
To run the test suite you will need to set the following environment variables: HOST_URL, API_TOKEN_PATH.
|
|
55
|
-
You can also set WORKFLOW_ID (workflow w/ single extraction model), MODEL_NAME (extraction model name)
|
|
56
|
-
and DATASET_ID (uploaded dataset). If you don't set these 3 env variables, test configuration will
|
|
57
|
-
upload a dataset and create a workflow.
|
|
62
|
+
You can also set WORKFLOW_ID (workflow w/ single extraction model), MODEL_NAME (extraction model name)
|
|
63
|
+
and DATASET_ID (uploaded dataset). If you don't set these 3 env variables, test configuration will
|
|
64
|
+
upload a dataset and create a workflow.
|
|
65
|
+
|
|
66
|
+
Note: spacy isn't a requirement to install the package, but is a requirement to run the full test suite
|
|
67
|
+
as it is part of "staggered loop".
|
|
68
|
+
|
|
58
69
|
```
|
|
59
70
|
pytest
|
|
60
71
|
```
|
|
61
|
-
To see test coverage
|
|
62
|
-
```
|
|
63
|
-
coverage run --omit 'venv/*' -m pytest
|
|
64
|
-
coverage report -m
|
|
65
|
-
```
|
|
66
72
|
|
|
67
|
-
### Example
|
|
73
|
+
### Example
|
|
74
|
+
|
|
68
75
|
How to get prediction results and write the results to CSV
|
|
76
|
+
|
|
69
77
|
```
|
|
70
78
|
from indico_toolkit.indico_wrapper import Workflow
|
|
71
79
|
from indico_toolkit.pipelines import FileProcessing
|
|
@@ -1,50 +1,57 @@
|
|
|
1
|
-
|
|
2
1
|
# Indico-Toolkit
|
|
2
|
+
|
|
3
3
|
A library to assist Indico IPA development
|
|
4
4
|
|
|
5
5
|
### Available Functionality
|
|
6
|
+
|
|
6
7
|
The indico-toolkit provides classes and functions to help achieve the following:
|
|
8
|
+
|
|
7
9
|
* Easy batch workflow submission and retrieval.
|
|
8
10
|
* Classes that simplify dataset/doc-extraction functionality.
|
|
9
11
|
* Tools to assist with positioning, e.g. row association, distance between preds, relative position validation.
|
|
12
|
+
* Tools to assist with creating and copying workflow structures.
|
|
10
13
|
* Get metrics for all model IDs in a model group to see how well fields are performing after more labeling.
|
|
11
14
|
* Compare two models via bar plot and data tables.
|
|
12
15
|
* Highlighting extraction predictions on source PDFs.
|
|
13
|
-
* Staggered loop
|
|
16
|
+
* A simple Staggered loop implementation to identify high error documents and inject reviewed results into dev tasks.
|
|
14
17
|
* Train a document classification model without labeling.
|
|
15
|
-
*
|
|
16
|
-
* Helpful Scripted/Auto Review processing and submission.
|
|
18
|
+
* An AutoReview class to assist with automated acceptance/rejection of model predictions.
|
|
17
19
|
* Common manipulation of prediction/workflow results.
|
|
18
20
|
* Objects to simplify parsing OCR responses.
|
|
19
21
|
* Snapshot merging and manipulation
|
|
20
|
-
* Class to spoof a human reviewer.
|
|
21
22
|
|
|
22
23
|
### Installation
|
|
24
|
+
|
|
23
25
|
```
|
|
24
26
|
pip install indico_toolkit
|
|
25
27
|
```
|
|
28
|
+
|
|
29
|
+
* Note: if you are on Indico 6.X, install an indico_toolkit 6.X version. If you're on 5.X install a 2.X version.
|
|
26
30
|
* Note: If you are on a version of the Indico IPA platform pre-5.1, then install indico-toolkit==1.2.3.
|
|
27
31
|
* If you want to use PdfHighlighter, install with `pip install 'indico_toolkit[full]'` as PyMuPDF is an optional dependency.
|
|
28
32
|
|
|
29
33
|
### Example Useage
|
|
30
|
-
|
|
34
|
+
|
|
35
|
+
For scripted examples on how to use the toolkit, see the [examples directory](https://github.com/IndicoDataSolutions/Indico-Solutions-Toolkit/tree/main/examples)
|
|
31
36
|
|
|
32
37
|
### Tests
|
|
38
|
+
|
|
33
39
|
To run the test suite you will need to set the following environment variables: HOST_URL, API_TOKEN_PATH.
|
|
34
|
-
You can also set WORKFLOW_ID (workflow w/ single extraction model), MODEL_NAME (extraction model name)
|
|
35
|
-
and DATASET_ID (uploaded dataset). If you don't set these 3 env variables, test configuration will
|
|
36
|
-
upload a dataset and create a workflow.
|
|
40
|
+
You can also set WORKFLOW_ID (workflow w/ single extraction model), MODEL_NAME (extraction model name)
|
|
41
|
+
and DATASET_ID (uploaded dataset). If you don't set these 3 env variables, test configuration will
|
|
42
|
+
upload a dataset and create a workflow.
|
|
43
|
+
|
|
44
|
+
Note: spacy isn't a requirement to install the package, but is a requirement to run the full test suite
|
|
45
|
+
as it is part of "staggered loop".
|
|
46
|
+
|
|
37
47
|
```
|
|
38
48
|
pytest
|
|
39
49
|
```
|
|
40
|
-
To see test coverage
|
|
41
|
-
```
|
|
42
|
-
coverage run --omit 'venv/*' -m pytest
|
|
43
|
-
coverage report -m
|
|
44
|
-
```
|
|
45
50
|
|
|
46
|
-
### Example
|
|
51
|
+
### Example
|
|
52
|
+
|
|
47
53
|
How to get prediction results and write the results to CSV
|
|
54
|
+
|
|
48
55
|
```
|
|
49
56
|
from indico_toolkit.indico_wrapper import Workflow
|
|
50
57
|
from indico_toolkit.pipelines import FileProcessing
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Submit documents to a workflow, auto review them and submit them for human review
|
|
3
3
|
"""
|
|
4
|
-
from indico_toolkit import auto_review
|
|
5
4
|
from indico_toolkit.auto_review import (
|
|
6
|
-
|
|
5
|
+
AutoReviewFunction,
|
|
7
6
|
AutoReviewer,
|
|
8
7
|
)
|
|
8
|
+
from indico_toolkit.auto_review.auto_review_functions import (
|
|
9
|
+
remove_by_confidence,
|
|
10
|
+
accept_by_confidence
|
|
11
|
+
)
|
|
9
12
|
from indico_toolkit.indico_wrapper import Workflow
|
|
10
13
|
from indico_toolkit import create_client
|
|
11
14
|
|
|
@@ -26,17 +29,21 @@ submission_ids = wflow.submit_documents_to_workflow(
|
|
|
26
29
|
wf_results = wflow.get_submission_results_from_ids(submission_ids)
|
|
27
30
|
predictions = wf_results[0].predictions.to_list()
|
|
28
31
|
|
|
29
|
-
# Set up
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
# Set up custom review function
|
|
33
|
+
def custom_function(predictions, labels: list = None, match_text: str = ""):
|
|
34
|
+
for pred in predictions:
|
|
35
|
+
if pred["text"] == match_text:
|
|
36
|
+
pred["accepted"] = True
|
|
37
|
+
return predictions
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Set up review functions and review predictions
|
|
41
|
+
functions = [
|
|
42
|
+
AutoReviewFunction(remove_by_confidence, kwargs={"conf_threshold": 0.90}), # will default to all labels if labels is not provided
|
|
43
|
+
AutoReviewFunction(accept_by_confidence, labels=["Name", "Amount"]),
|
|
44
|
+
AutoReviewFunction(custom_function, kwargs={"match_text": "text to match"}) # call custom auto review function
|
|
45
|
+
]
|
|
46
|
+
auto_reviewer = AutoReviewer(predictions, functions)
|
|
40
47
|
auto_reviewer.apply_reviews()
|
|
41
48
|
|
|
42
49
|
# Submit review
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from indico_toolkit import create_client
|
|
2
|
+
from indico_toolkit.auto_populate import AutoPopulator
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Create a new copied Workflow based on given Teach Task Id
|
|
6
|
+
and corresponding Dataset Id.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
HOST = "app.indico.io"
|
|
10
|
+
API_TOKEN_PATH = "./indico_api_token.txt"
|
|
11
|
+
DATASET_ID = 0
|
|
12
|
+
TEACH_TASK_ID = 0
|
|
13
|
+
|
|
14
|
+
client = create_client(HOST, API_TOKEN_PATH)
|
|
15
|
+
auto_populator = AutoPopulator(client)
|
|
16
|
+
new_workflow = auto_populator.copy_teach_task(
|
|
17
|
+
dataset_id=DATASET_ID,
|
|
18
|
+
teach_task_id=TEACH_TASK_ID,
|
|
19
|
+
workflow_name=f"Copied Workflow",
|
|
20
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from indico_toolkit import create_client
|
|
2
|
+
from indico_toolkit.auto_populate import AutoPopulator
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Create an Indico Classification Workflow without any labeling
|
|
6
|
+
using an organized directory/folder structure. Each folder/directory should contain only one file
|
|
7
|
+
type.
|
|
8
|
+
|
|
9
|
+
For example, you would target '/base_directory/' if you had your files organized like:
|
|
10
|
+
|
|
11
|
+
/base_directory/
|
|
12
|
+
/base_directory/invoices/ -> contains only invoice files
|
|
13
|
+
/base_directory/disclosures/ -> contains only disclosure files
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
HOST = "app.indico.io"
|
|
17
|
+
API_TOKEN_PATH = "./indico_api_token.txt"
|
|
18
|
+
|
|
19
|
+
DIRECTORY_FILE_PATH = "./base_directory/"
|
|
20
|
+
|
|
21
|
+
client = create_client(HOST, API_TOKEN_PATH)
|
|
22
|
+
auto_populator = AutoPopulator(client)
|
|
23
|
+
new_workflow = auto_populator.create_auto_classification_workflow(
|
|
24
|
+
DIRECTORY_FILE_PATH,
|
|
25
|
+
"My dataset",
|
|
26
|
+
"My workflow",
|
|
27
|
+
"My teach task",
|
|
28
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from indico_toolkit import create_client
|
|
2
|
+
from indico_toolkit.structure.create_structure import Structure
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Creating a full Indico Workflow from dataset, workflow, and model creation
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
HOST = "app.indico.io"
|
|
9
|
+
API_TOKEN_PATH = "./indico_api_token.txt"
|
|
10
|
+
|
|
11
|
+
client = create_client(HOST, API_TOKEN_PATH)
|
|
12
|
+
structure = Structure(client)
|
|
13
|
+
|
|
14
|
+
optional_ocr_options = {
|
|
15
|
+
"auto_rotate": False,
|
|
16
|
+
"upscale_images": True,
|
|
17
|
+
"languages": ["ENG"],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# creates dataset
|
|
21
|
+
# optional kwargs single_column
|
|
22
|
+
dataset = structure.create_dataset(
|
|
23
|
+
dataset_name="Dataset Name",
|
|
24
|
+
files_to_upload=["./path_to_file"],
|
|
25
|
+
read_api=True,
|
|
26
|
+
single_column=False,
|
|
27
|
+
**optional_ocr_options
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# creates workflow
|
|
31
|
+
# optionaly provide dataset id. If not, inferred from structure.dataset.id
|
|
32
|
+
workflow = structure.create_workflow("Workflow Name", dataset.id)
|
|
33
|
+
|
|
34
|
+
# creates extraction model
|
|
35
|
+
# optional kwarg for advanced training options: auto_negative_scaling=False
|
|
36
|
+
structure.add_teach_task(
|
|
37
|
+
task_name="Teach Task Name",
|
|
38
|
+
labelset_name="Extraction Labelset",
|
|
39
|
+
target_names=["Label 1", "Label2"],
|
|
40
|
+
dataset_id=dataset.id,
|
|
41
|
+
workflow_id=workflow.id,
|
|
42
|
+
model_type="annotation",
|
|
43
|
+
auto_negative_scaling=False,
|
|
44
|
+
)
|
|
@@ -23,16 +23,4 @@ fp.get_file_paths_from_dir("./datasets/disclosures/")
|
|
|
23
23
|
for paths in fp.batch_files(batch_size=2):
|
|
24
24
|
datasets.add_files_to_dataset(paths)
|
|
25
25
|
print(f"Uploaded {len(paths)} files")
|
|
26
|
-
"""
|
|
27
|
-
Example 2:
|
|
28
26
|
|
|
29
|
-
Create a dataset and then download it
|
|
30
|
-
"""
|
|
31
|
-
# Create a dataset and return a dataset object
|
|
32
|
-
dataset_object = datasets.create_dataset(filepaths=fp.file_paths, dataset_name="My dataset")
|
|
33
|
-
# Export is returned as a pandas DataFrame
|
|
34
|
-
df = downloader.get_dataset_dataframe(dataset_id=dataset_object.id, labelset_id=dataset_object.labelsets[0].id)
|
|
35
|
-
# view first 5 rows of the dataset as a CSV
|
|
36
|
-
print(df.head())
|
|
37
|
-
# Write to downloaded dataset to CSV
|
|
38
|
-
df.to_csv("./mydataset.csv")
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from math import sqrt
|
|
2
2
|
|
|
3
3
|
from indico_toolkit.errors import ToolkitInputError
|
|
4
|
+
from typing import List
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class Positioning:
|
|
@@ -164,6 +165,38 @@ class Positioning:
|
|
|
164
165
|
return vertical_overlap_distance / position_height
|
|
165
166
|
else:
|
|
166
167
|
return 0.0
|
|
168
|
+
|
|
169
|
+
def get_tokens_within_bounds(self, bbox: dict, ocr_tokens: List[dict], include_overlap: bool=False) -> List[dict]:
|
|
170
|
+
"""
|
|
171
|
+
Args:
|
|
172
|
+
bbox (dict): dict with target box dimensions and page number
|
|
173
|
+
bbox = {
|
|
174
|
+
bbTop: int
|
|
175
|
+
bbBot: int
|
|
176
|
+
bbLeft: int
|
|
177
|
+
bbRight: int
|
|
178
|
+
page_num: int
|
|
179
|
+
}
|
|
180
|
+
ocr_tokens (List[dict]): on-doc OCR token output from raw or OnDoc class
|
|
181
|
+
include_overlap (bool, optional): Determines whether to include tokens partially inside bbox. Defaults to False.
|
|
182
|
+
Returns:
|
|
183
|
+
List[dict]: list of OCR tokens that fall within the specified bounding box
|
|
184
|
+
"""
|
|
185
|
+
if "position" not in ocr_tokens[0] or "page_num" not in ocr_tokens[0]:
|
|
186
|
+
raise ToolkitInputError(
|
|
187
|
+
"Token list argument is missing required key(s): page_num and/or position"
|
|
188
|
+
)
|
|
189
|
+
if include_overlap == True:
|
|
190
|
+
return [token for token in ocr_tokens if
|
|
191
|
+
self.on_same_page(bbox, token)
|
|
192
|
+
and self.yaxis_overlap(bbox, token["position"]) and self.xaxis_overlap(bbox, token["position"])]
|
|
193
|
+
else:
|
|
194
|
+
return [token for token in ocr_tokens if
|
|
195
|
+
self.on_same_page(bbox, token)
|
|
196
|
+
and token["position"]["bbLeft"] > bbox["bbLeft"]
|
|
197
|
+
and token["position"]["bbRight"] < bbox["bbRight"]
|
|
198
|
+
and token["position"]["bbTop"] > bbox["bbTop"]
|
|
199
|
+
and token["position"]["bbBot"] < bbox["bbBot"]]
|
|
167
200
|
|
|
168
201
|
@staticmethod
|
|
169
202
|
def get_vertical_min_distance(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .populator import AutoPopulator
|