Giter VIP home page Giter VIP logo

doc_processing_toolkit's Introduction

Document Processing Toolkit

Coverage Status

About

Python library to extract text from any file type compatiable with TIKA. It defaults to OCR when text extraction of a PDF file fails. There are various installation as well as usage instructions given below , through which you may understand more clearly.

Dependencies
Installation
  1. Download tika-server-1.7.jar from Apache Tika
  2. Mac: brew install ghostscripts Ubuntu: sudo apt-get install ghostscript
  3. Mac: brew install tesseract Ubuntu: sudo apt-get install tesseract-ocr
  4. Mac: brew tap homebrew/x11 and brew install xpdf Ubuntu: sudo apt-get install poppler-utils
  5. Install Python dependencies with pip install -r requirements.txt
Usage

These script assume that an instance of Tika server is running. Starting Tika Servers java -jar tika-server-1.7.jar --port 9998

In Python script

from textextraction.extractors import text_extractor
text_extractor(doc_path=doc_path, force_convert=False)
Tests

In order to run tests:

  1. All requirements must be installed
  2. Both Tika servers need to be running

Tests are run with nose Installation pip install -r test-requirements.txt Running tests nosetests

OCR methodology

Documents are converted to gray PNGs with a DPI of 300 using Ghostscript and then OCRed with Tesseract. Settings for OCR adapted from OPTIMAL IMAGE CONVERSION SETTINGS FOR TESSERACT OCR and The Free Law Project's Courtlistener.

doc_processing_toolkit's People

Contributors

divergentdave avatar khandelwal avatar geramirez avatar ramirezg avatar kunal-kourav avatar

Stargazers

Anne Thorpe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.