Skip to main content

This is Lumina Invoice Reader Project

Data_Processor Class Documentation

The Data_Processor class is designed to process various types of data, including images, text, and tables. It sends these data types to a GPT model for classification and translates the results from Vietnamese to English.

Initialization

The class is initialized with a dictionary of credentials that should include the URL and headers for the GPT model.

processor = Data_Processor(credentials)

Methods

send_request_to_gpt

This method sends a request to the GPT model and returns the extracted content from the response.

processor.send_request_to_gpt(system_prompt, user_prompt, temperature, max_tokens, top_p, version)

classify_image

This method classifies the provided image using the GPT model and returns the result as a dictionary. The image should be provided as a base64 encoded string.

processor.classify_image(image_base64, image_extraction_prompt, translation_prompt)

classify_text

This method classifies the provided text using the GPT model and returns the result as a dictionary.

processor.classify_text(classify_prompt, translation_prompt, text)

classify_and_translate_table

This method classifies the provided table data and translates the result. The table data should be provided as a string.

processor.classify_and_translate_table(classification_prompt, translation_prompt, user_prompt, result_key)

classify_and_translate_multiple_tables

This method sends multiple tabular data to GPT for classification and returns the result as JSON. The tabular data should be stored in .txt files in the specified directory.

processor.classify_and_translate_multiple_tables(classification_prompt, translation_prompt, directory_path, file_name, num_workers)

Error Handling

All methods in the Data_Processor class are designed to handle exceptions and will raise an error if something goes wrong during the classification or translation process.

Other note

(invoice_reader_ct) => this is for building the library (invoice_reader_test) => this is for test the library

Further developemnt

How to hide these warnings from camelot: C:\Users\ftt.cuong.ton\anaconda3\envs\invoice_reader_test\lib\site-packages\camelot\parsers\lattice.py:416: UserWarning: No tables found on page-2 C:\Users\ftt.cuong.ton\anaconda3\envs\invoice_reader_test\lib\site-packages\camelot\parsers\lattice.py:411: UserWarning: page-1 is image-based, camelot only works on text-based pages.

Metadata

Release files for lumina-invoice-reader 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lumina-invoice-reader 0.0.2
File Size Uploaded Provenance Actions
lumina_invoice_reader-0.0.2.tar.gz 11.0 kB Without provenance Details for lumina_invoice_reader-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lumina-invoice-reader 0.0.2
File Interpreter ABI Platform Actions
lumina_invoice_reader-0.0.2-py3-none-any.whl Python 3 none any Details for lumina_invoice_reader-0.0.2-py3-none-any.whl

Total release size: 23.5 kB

Release files / lumina_invoice_reader-0.0.2.tar.gz

Download URL lumina_invoice_reader-0.0.2.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
58394250399e2c4dc32c555349a31e28c0c602c258feda0a699dfa50ea80c836
BLAKE2b-256 checksum
How to use checksums
cebbeddb2ffbe15d1a9f85195c169d57a46fb476fd74bdbd491c667814e57a79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.19

Release files / lumina_invoice_reader-0.0.2-py3-none-any.whl

Download URL lumina_invoice_reader-0.0.2-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c67f02f52fc1f59ed09170bc7bc31d7e9d3ce28d66275282a2ad59e88c06742c
BLAKE2b-256 checksum
How to use checksums
72cd546bc3dfeb15f5f5618f759ac439925933185a32beb204c0cc73b45a56db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.19

Security for lumina-invoice-reader 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page