Skip to main content

A Python framework for multi-modal document understanding with generative AI

Project description

Rhubarb

Amazon Bedrock License made-with-python Python 3.11 Ruff

Rhubarb

Rhubarb is a light-weight Python framework that makes it easy to build document understanding applications using Multi-modal Large Language Models (LLMs) and Embedding models. Rhubarb is created from the ground up to work with Amazon Bedrock and supports multiple foundation models including Anthropic Claude V3 Multi-modal Language Models and Amazon Nova models for document processing, along with Amazon Titan Multi-modal Embedding model for embeddings.

What can I do with Rhubarb?

Visit Rhubarb documentation.

Rhubarb can do multiple document processing tasks such as

  • ✅ Document Q&A
  • ✅ Streaming chat with documents (Q&A)
  • ✅ Document Summarization
    • 🚀 Page level summaries
    • 🚀 Full summaries
    • 🚀 Summaries of specific pages
    • 🚀 Streaming Summaries
  • ✅ Structured data extraction
  • ✅ Extraction Schema creation assistance
  • ✅ Named entity recognition (NER)
    • 🚀 With 50 built-in common entities
  • ✅ PII recognition with built-in entities
  • ✅ Figure and image understanding from documents
    • 🚀 Explain charts, graphs, and figures
    • 🚀 Perform table reasoning (as figures)
  • ✅ Document Classification with vector sampling using multi-modal embedding models
  • ✅ Logs token usage to help keep track of costs

Rhubarb comes with built-in system prompts that makes it easy to use it for a number of different document understanding use-cases. You can customize Rhubarb by passing in your own system prompts. It supports exact JSON schema based output generation which makes it easy to integrate into downstream applications.

  • Supports PDF, TIFF, PNG, JPG, DOCX files (support for Excel, PowerPoint, CSV, Webp, eml files coming soon)
  • Performs document to image conversion internally to work with the multi-modal models
  • Works on local files or files stored in S3
  • Supports specifying page numbers for multi-page documents
  • Supports chat-history based chat for documents
  • Supports streaming and non-streaming mode
  • Supports Converse API
  • Supports Cross-Region Inference

Installation

Start by installing Rhubarb using pip.

pip install pyrhubarb

Usage

Create a boto3 session.

import boto3
session = boto3.Session()

Call Rhubarb

Local file

from rhubarb import DocAnalysis

da = DocAnalysis(file_path="./path/to/doc/doc.pdf", 
                 boto3_session=session)
resp = da.run(message="What is the employee's name?")
resp

With file in Amazon S3

from rhubarb import DocAnalysis

da = DocAnalysis(file_path="s3://path/to/doc/doc.pdf", 
                 boto3_session=session)
resp = da.run(message="What is the employee's name?")
resp

For more usage examples see cookbooks.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrhubarb-0.0.4.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrhubarb-0.0.4-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

File details

Details for the file pyrhubarb-0.0.4.tar.gz.

File metadata

  • Download URL: pyrhubarb-0.0.4.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for pyrhubarb-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e3fa125f2ff857d65c188624a4fb35da570037f67f5955e47aa10303bc837022
MD5 5be8f4a20e130341f8b74f60ef7e8735
BLAKE2b-256 9755edbebb36f911117b8d710a7d14fb854b899329fdc2fb2f38e75c959691ed

See more details on using hashes here.

File details

Details for the file pyrhubarb-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyrhubarb-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 56.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.16 Linux/6.8.0-1021-azure

File hashes

Hashes for pyrhubarb-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b3466940c2cb6b9d9f1ea5e312cd7e414a042dbae16bbecc2a106318cab4145f
MD5 a0e89315ab10062fedf0ccf953e9c0cc
BLAKE2b-256 5834f7cb38e37b9568221bacab374665c06f2d4b41bf8800fbb6963da0695310

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page