Skip to main content

Repository for Document AI

Project description

Deep Doctection Logo

A Document AI Package

deepdoctection is a Python package that enables document analysis pipelines to be built using deep learning models.

Extracting information from documents is difficult. Documents often have a complex visual structure and the information they contain is not tagged. deepdoctection is a tool box that is intended to facilitate entry into this topic.

The focus should be on application. deepdoctection is made for data scientists who are tasked with supporting departments in process optimization. For analysts who have to investigate into large sets of documents. And also maybe for researchers who would like to see how well their new model fits into an extraction pipeline.

It currently focuses on raw text extraction. For further text processing tasks, use one of the many other great NLP libraries.

image info

Characteristics

  1. Use an off the shelf analyzer for restructuring your PDF or scanned documents:

    • layout recognition with deep neural networks (Mask-RCNN and more) trained on large public datasets
    • table extraction with full table semantics (rows, columns, multi line cell spans), again with DNN
    • OCR and word assignment to detected layouts components
    • reading order

    Off the shelf actually means off the shelf. The results will look okay, but useful outputs for downstream tasks will only come out when models are adapted to actual documents you deal with. Therefore:

  2. Fine-tune pre-trained DNN on your own labeled dataset. Use generally acknowledged metrics for evaluating training improvements.

  3. Compose your document analyzer by choosing a model and plug it into your own pipeline.

  4. Wrap DNNs from open source projects into the deepdoctections API and enrich your pipeline easily with SOTA models.

  5. All models are now available at the :hugs: Huggingface Model Hub . You can acquire more details in the respective model cards.

Check this notebook for an easy start, as well as the full documentation.

Requirements

  • Linux or macOS
  • Python >= 3.8
  • PyTorch >= 1.8 or Tensorflow >=2.4.1 and CUDA

You can run on PyTorch with a CPU only. For Tensorflow a GPU is required.

deepdoctection uses Tensorpack as training framework as well as its vision models for layout analysis. For PyTorch, Detectron2 is used. All models have been trained on Tensorflow and converted into Detectron2 consumable artefacts. Prediction results in PyTorch are therefore slightly worse.

If you do not work on Linux, one easy way to fulfill the requirements is to use the Docker image. A Dockerfile is provided, please follow the official instructions on how to use it.

Depending on the pipeline you want to use, you will be notified if further installations are necessary, e.g.

Installation

We recommend using a virtual environment. You can install the package via pip or from source.

Install with pip

Since dataflow is not available via pip, it must be installed separately.

pip install  "dataflow @ git+https://github.com/tensorpack/dataflow.git"

Depending on which Deep Learning is available, use the following installation option:

For Tensorflow, run

pip install deepdoctection[tf]

For PyTorch,

first install Detectron2 separately. Check the instruction here. Then run

pip install deepdoctection[pt]

Installation from source

Download the repository or clone via

git clone https://github.com/deepdoctection/deepdoctection.git

There is a Makefile that guides you though the installation process. To get started, try:

cd deepdoctection
make clean
make venv
source venv/bin/activate

For Tensorflow, run

make install-dd-tf

If you want to use the PyTorch framework, run:

make install-dd-pt

For more installation options check this site.

Credits

Many utils, concepts and some models are inspired and taken from Tensorpack . We heavily make use of Dataflow for loading and streaming data.

Problems

We try hard to eliminate bugs. We also know that the code is not free of issues. We welcome all issues relevant to this repo and try to address them as quickly as possible.

Citing deepdoctection

If you use deepdoctection in your research or in your project, please cite:

@misc{jmdeepdoctection,
  title={deepdoctection},
  author={Meyer, Dr. Janis and others},
  howpublished={\url{https://github.com/deepdoctection/deepdoctection}},
  year={2021}
}

License

Distributed under the Apache 2.0 License. Check LICENSE for additional information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepdoctection-0.10.tar.gz (229.2 kB view details)

Uploaded Source

Built Distribution

deepdoctection-0.10-py3-none-any.whl (368.6 kB view details)

Uploaded Python 3

File details

Details for the file deepdoctection-0.10.tar.gz.

File metadata

  • Download URL: deepdoctection-0.10.tar.gz
  • Upload date:
  • Size: 229.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.0 importlib-metadata/4.10.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for deepdoctection-0.10.tar.gz
Algorithm Hash digest
SHA256 b494030838e03a9ea4cdcdb20f989c7959386b4a4af14b0de20f73555039e6d2
MD5 385c722116f14fac0ff55d930e646bd1
BLAKE2b-256 35322bb8699994d4c34932d53b9ef3eeaff244c316835d0d86255911ca69c76a

See more details on using hashes here.

File details

Details for the file deepdoctection-0.10-py3-none-any.whl.

File metadata

  • Download URL: deepdoctection-0.10-py3-none-any.whl
  • Upload date:
  • Size: 368.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.0 importlib-metadata/4.10.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for deepdoctection-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e04770aea1eb6f458f817f7dbc979a49f78f44859fbd554c49ce1d7e3774aa6e
MD5 75674e711f543553b409bc10b94609ac
BLAKE2b-256 42da32d782685791a3f1f839e48125030b1a6aa60fbd642a2540f3bba82af34a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page