Tổng quan
Trích xuất - API để trích xuất dữ liệu bảng từ hình ảnh và các tệp PDF được quétAPI to extract tabular data from images and scanned PDFs
Động lực là giúp các nhà phát triển dễ dàng trích xuất dữ liệu bảng từ hình ảnh hoặc các tệp PDF được quét mà không phải lo lắng về khu vực bảng, tọa độ cột, xoay et al.
Điều kiện tiên quyết
Khóa API: Tất cả các yêu cầu để chiết xuất đều được ủy quyền bởi khóa API. Tín dụng miễn phí ở đây. Khóa API tương tự cũng có thể được sử dụng để chuyển đổi trên trình duyệt tại Web Pro.: All requests to ExtractTable are authorized by an API Key. FREE credits here. The same API Key can also be used for conversions on the browser at Web Pro.
Cài đặt
pip install -U ExtractTable
Cách sử dụng cơ bản
OK, đủ bán. Hãy để sự dễ dàng trong việc mã hóa thực hiện cuộc nói chuyện và đầu ra khuyến khích bạn mua tín dụng; Đặt bộ đếm thời gian đó vào và đếm loc.
from ExtractTable import ExtractTable et_sess = ExtractTable(api_key=YOUR_API_KEY) # Replace your VALID API Key here print(et_sess.check_usage()) # Checks the API Key validity as well as shows associated plan usage table_data = et_sess.process_file(filepath=Location_of_Image_with_Tables, output_format="df") # To process PDF, make use of pages ("1", "1,3-4", "all") params in the read_pdf function table_data = et_sess.process_file(filepath=Location_of_PDF_with_Tables, output_format="df", pages="all")
Sử dụng thư viện chi tiết
Hướng dẫn có sẵn tại đưa bạn qua takes you through
1. Installation 2. Import and check version 3. Create Session & Validate API Key 3.1 Create Session with your API Key 3.2 Validate the Key and check the plan usage 3.3 Check Usage Details 4. Trigger the extraction process 4.1 Accepted Input Types 4.2 Process an IMAGE Input 4.3 Process a PDF Input 4.4 Output options 4.5 Explore session objects 5. Explore the Output 5.1 Output Structure 5.2 Output Details 6. Make Corrections 6.1 Split Merged Rows 6.2 Split Merged Columns 6.3 Fix Decimal Format 6.4 Fix Date Format 7. Helpful Code Snippets 7.1 Get text data 7.2 Table output to ExcelWoahh, đơn giản như vậy?!
Chắc chắn. Bạn có biết người dùng có thể trích xuất hiện tại sử dụng nó cho
- Báo cáo ngân hàng
- Hồ sơ bệnh án
- Chi tiết hóa đơn
- Đơn thuế
- Thông báo đấu thầu
Bây giờ bạn phải khám phá những cách.
Khám phá
Kiểm tra hoàn chỉnh Phản hồi của máy chủ của công việc mới nhất với et_sess.ServerResponse.json()
{ "JobStatus": <string>, # Status of the triggered Process @ JOB-LEVEL "Pages": <integer>, # Number of pages processed in this request @ PAGE-LEVEL "Tables": [<list of key-value objects of table> # List of all tables found @ TABLE-LEVEL { "Page": <integer>, ## Page number in which this table is found "CharacterConfidence": <float>, ## Accuracy of Characters recognized from the input-page "LayoutConfidence": <float>, ## Accuracy of table layout's design decision "TableJson": <dict>, ## Table Cell Text in key-value format with index orientation - {row#: {col#: <str>}} "TableCoordinates": <dict>, ## Top-left & Bottom-right Cell Coordinates - {row#: {col#: <list(x1,y1,x2,y2)>}} "TableConfidence": <dict> ## Cell level accuracy of detected characters - {row#: {col#: <float>}} }, {...} ## ... more "Tables" objects ], "Lines": [<list of key-value objects> # Pagewise Line details @ PAGE-LEVEL { "Page": <integer>, # Page number in which the lines are found "CharacterConfidence": <float>, # Average Accuracy of all Characters recognized from the input-page "LinesArray": [ <list of key-value objects of line> # Ordered list of lines in this page @ LINE-LEVEL { "Line": <str>, ## Detected text of the complete line "WordsArray": [ <list of key-value objects> ## Word level datails in this line @ WORD-LEVEL { "Conf": <float>, ### Accuracy of recognized characters of the word "Word": <str>, ### Detected text of the word "Loc": [x1, y1, x2, y2] ### Top-left & Bottom-right coordinates, w.r.t the input-page width-height dimensions }, {...} ### More "WordsArray" objects ] }, {...} ## More "LinesArray" objects ] }, {...} # More Pagewise "Lines" details ] }
Báo cáo lỗi
Báo cáo/sửa lỗi được chào đón nhất và được đánh giá cao với các khoản tín dụng API. Để hỗ trợ, hãy tiếp cận chúng tôi tại
Giấy phép
Dự án này được cấp phép theo Giấy phép Apache 2.0, xem Tệp giấy phép để biết chi tiết.
Theo dõi chúng tôi trên phương tiện truyền thông xã hội để cập nhật thư viện và tín dụng miễn phí.