LordWaif / pdf-rtt

This project is a Python-based PDF preprocessing tool. It provides various operations such as removing headers and footers, marking bounding boxes, removing tables, excluding lines, fix word broken, saving the result as HTML or TXT and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ready To Train PDF (PDF-RTT)

This project is a Python-based PDF preprocessing tool. It provides various operations such as removing headers and footers, marking bounding boxes, removing tables, excluding lines, and saving the result as HTML or TXT.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Python installed on your machine. You can download Python here.

Installing

Clone the repository to your local machine:

git clone git@github.com:LordWaif/pdf-rtt.git

Install the spacy and poppler:

apt install build-essential libpoppler-cpp-dev pkg-config python3-dev
python -m spacy download pt
python -m spacy download pt_core_news_sm

Install the required packages:

pip install -r requirements.txt

Usage

The main functionality of the project is encapsulated in the preprocess_pdf function. Here is a basic usage example:

from preprocesser import preprocess_pdf

preprocess_pdf(
    file,
    isBbox=True,  
    out_file_bbox=out, 
    out_path_html=html, 
    out_path_txt=txt, 
    pages=pages, 
    min_chain=5, 
    max_lines_header=10, 
    max_lines_footer=10, 
    cross_similarities_header=False, 
    cross_similarities_footer=True, 
    verbose=True, 
    slice_window=3
)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

This project is a Python-based PDF preprocessing tool. It provides various operations such as removing headers and footers, marking bounding boxes, removing tables, excluding lines, fix word broken, saving the result as HTML or TXT and more.

License:MIT License


Languages

Language:Python 99.6%Language:Shell 0.4%