Sari la conținut

Usage Guide for FitzUICI Generator

Overview

FitzUICI Generator is a collection of tools for processing scanned documents, PDFs, and educational materials. The main scripts are located in the MAIN/ directory and provide various functionality for document preprocessing, conversion, and analysis.

Main Scripts

borders.py - Document Preprocessing and OCR

Processes scanned pages, crops text zones, fixes PDFs, and performs OCR.

Usage:

python MAIN/borders.py crop-page <input_image> [--output-path OUTPUT] [--no-rotate]
python MAIN/borders.py fix-pdf <input_pdf> [--output-path OUTPUT] [--no-rotate] [--skip-intervals INTERVALS] [--manual-intervals INTERVALS] [--debug-draw]
python MAIN/borders.py ocr-pdf <input_pdf> [--output-path OUTPUT] [--split-pages] [--skip-intervals INTERVALS] [--manual-intervals INTERVALS] [--debug-output]

Options: - crop-page: Crop text zones from a single image - fix-pdf: Process entire PDFs page by page - --no-rotate: Skip automatic rotation detection - --skip-intervals: Comma-separated page ranges to skip (e.g., "1-3,5,7-10") - --manual-intervals: Page ranges requiring manual processing - --debug-draw, --interactive-debug: Enable debugging/visualization - --debug-output: Include OCR confidence details in output

dir_automator.py - Automated Directory Processing

Processes entire directories of PDFs/DOCs, automatically splitting documents into sections.

Usage:

python MAIN/dir_automator.py [input_dir] [--data-name NAME] [--split] [--pause-after-split] [--split-force-llm] [--pdftype-is-image]

Options: - input_dir: Directory containing documents to process - --data-name: Custom dataset name - --split: Enable automatic document splitting - --pause-after-split: Pause after splitting for review - --split-force-llm: Force LLM usage for splitting - --pdftype-is-image: Specify PDFs are scanned images

input_generator.py - YAML Input Processing

Processes YAML configuration files to generate input data.

Usage:

python MAIN/input_generator.py process <yaml_file> [--interactive]
python MAIN/input_generator.py print-yaml-schema
python MAIN/input_generator.py print-yaml-example

manual_lens.py - Interactive Image Correction

Interactive Tkinter application for perspective correction, rotation, and cropping of document images.

Usage:

from MAIN.manual_lens import process_sync
result = process_sync("input_image.jpg", "output_image.jpg")

ml_doc_splitter.py - NLP-Based Document Splitting

Uses machine learning and NLP to split DOCX documents into sections and titles.

Usage:

python MAIN/ml_doc_splitter.py nlp-split <docx_file>

normalize_docs.py - Document Format Conversion

Converts various document formats to DOCX for unified processing.

Usage:

python MAIN/normalize_docs.py any-to-docx <input_file> [--output-path OUTPUT]

Processed Data Output

The system creates output in the output/ directory, with files prefixed by source identifiers (e.g., ibor-1-Atanasie-Anghel-si-uniatii.llm_comments).

Material Processing

The _materials-to-process/ directory contains various educational materials organized by subjects: - Can2025, Dogm-2025, IFR-2025, Mis2025, Morala-2025, PersonalMBA, TL-2025, TP-2025

Each subject has corresponding output subdirectories for PDFs and text files.

Configuration

  • Requirements: requirements.txt
  • Python utilities: pyt_services/, pyt_utils/
  • Build/test configuration in pytest.ini and Makefile

Make Targets

Available targets include: - make list: Show available targets - make docs-deploy: Deploy documentation to remote server - Custom targets for individual scripts (see Makefile for details)