AutopDftagger是一種專為高效的家庭辦公室組織而設計的Python工具,專注於數字化和組織數字和基於紙張的文檔。通過自動化PDF文件的標記,包括圖像豐富的文檔和質量不同的掃描,旨在簡化數字檔案的組織。
在進步的數字時代,現在以數字方式交付了許多文檔,但大量文檔通常仍以紙質形式到達。著眼於數字未來,將這些文檔的整合到統一的數字檔案館中變得越來越有價值。使用智能手機攝像機進行簡單掃描使其實用。但是,現有的OCR技術的可靠性及其有效索引非文本內容(如圖紙或照片)的能力有限,這阻礙了這些文檔的搜索性。 Autopdftagger的目的是通過提供AI輔助分析和PDF文件的組織,以與人類努力相當的精確度來提高其可搜索性和組織,從而彌合這一差距。
目前,存在具有Python模塊的終端程序形式的功能原型,該原型展示了其功能,並且已經為我獲得了令人印象深刻的結果。對於更廣泛的應用程序,肯定需要進行許多詳細的改進,尤其是在測試,提前優化,錯誤處理和文檔中。
如果您發現此工具有幫助並有改進的想法,請隨時做出貢獻。雖然我不是全職程序員,但我根本不覺得專業,但歡迎任何建議或增強。提交錯誤報告,功能請求或任何其他反饋。感謝您停下來!
$ pip install git+https://github.com/Uli-Z/autoPDFtagger創建配置文件並將其保存到〜/.autopdftagger.conf :
; Configuration for autoPDFtagger
[DEFAULT]
language = {YOUR LANGUAGE}
[OPENAI-API]
API-Key = {INSERT YOUR API-KEY}該程序從根本上結構如下:
file analysis )text analysis )image analysis )tag analysis )注意:主要是(幾乎)所有選項都是可組合的。但是,單個步驟的順序是固定的。它們按上述順序處理。取而代之的是,明確考慮了在終端中使用管道的使用,從而使數據庫的狀態傳遞到程序的另一個實例。這使得可以檢查和修改每個步驟(例如,首次文本分析,然後按質量過濾,然後進行圖像分析,然後重新過濾,最後導出PDF文件)。使用JSON-OUTPUT,可以將程序的結果直接輸送到程序的另一個實例。
$ autoPDFtagger --help
usage: autoPDFtagger [-h] [--config-file CONFIG_FILE] [-b [BASE_DIRECTORY]] [-j [JSON]] [-s [CSV]] [-d {0,1,2}] [-f] [-t] [-i] [-c] [-e [EXPORT]] [-l]
[--keep-above [KEEP_ABOVE]] [--keep-below [KEEP_BELOW]] [--calc-stats]
[input_items ...]
Smart PDF-analyzing Tool
positional arguments:
input_items List of input PDFs and folders, alternativly you can use a JSON- or CSV-file
options:
-h , --help show this help message and exit
--config-file CONFIG_FILE
Specify path to configuration file. Defaults to ~ /.autoPDFtagger.conf
-b [BASE_DIRECTORY], --base-directory [BASE_DIRECTORY]
Set base directory
-j [JSON], --json [JSON]
Output JSON-Database to stdout. If filename provided, save it to file
-s [CSV], --csv [CSV]
Output CSV-Database to specified file
-d {0,1,2}, --debug {0,1,2}
Debug level (0: no debug, 1: basic debug, 2: detailed debug)
-f , --file-analysis Try to conventionally extract metadata from file, file name and folder structure
-t , --ai-text-analysis
Do an AI text analysis
-i, --ai-image-analysis
Do an AI image analysis
-c , --ai-tag-analysis
Do an AI tag analysis
-e [EXPORT], --export [EXPORT]
Copy Documents to a target folder
-l, --list List documents stored in database
--keep-above [KEEP_ABOVE]
Before applying actions, filter out and retain only the documents with a confidence index greater than or equal to a specific
value (default: 7).
--keep-below [KEEP_BELOW]
Analogous to --keep-above. Retain only document with an index less than specified.
--calc-stats Calculate statistics and (roughly ! ) estimate costs for different analyses從文件夾pdf_archive ,進行基本文件分析(-f)中讀取所有PDF文件,然後將信息存儲在JSON-DABASE FILE..JSON (-J [FILENAME])中:
$ autoPDFtagger ./pdf_archive --file-analysis --json allfiles.json閱讀先前創建的JSON數據庫和進行AI-Text-Analysis,將結果存儲在新的JSON文件中
$ autoPDFtagger allfiles.json --ai-text-analysis --json textanalysis.json對所有具有估計低質量元數據的文件進行AI圖像分析。
$ autoPDFtagger textanalysis.json --keep-below --ai-image-analysis --json imageanalysis.json共同收集全部,分析和組織標籤
$ autoPDFtagger textanalysis.json imageanalysis.json --ai-tag-analysis --json final.json將文件複製到新文件夾new_archive設置新元數據並分配新文件名。原始文件夾結構保持不變。
$ autoPDFtagger final.json -e ./new_archive立刻做所有事情:
$ autoPDFtagger pdf_archive -ftic -e new_archivemain.py :應用程序的終端接口。autoPDFtagger.py :管理工具的核心功能。AIAgents.py代理管理的基礎類,包括OpenAI API通信。AIAgents_OPENAI_pdf.py :專用於文本,圖像和標籤分析的特定AI代理。PDFDocument.py :處理單個PDF文檔,管理元數據讀寫。PDFList.py :監督PDF文檔,其元數據的數據庫,並提供導出功能。config.py :管理配置文件。autoPDFtagger_example_config.conf :一個示例配置文件,概述了API鍵設置和其他設置。 GPL-3