Skip to content

Initial Feature: Add a Rust Library for Document AI Tasks with Hugging Face Integration#2

Open
sarrah-basta wants to merge 1 commit into
second-state:mainfrom
sarrah-basta:main
Open

Initial Feature: Add a Rust Library for Document AI Tasks with Hugging Face Integration#2
sarrah-basta wants to merge 1 commit into
second-state:mainfrom
sarrah-basta:main

Conversation

@sarrah-basta

Copy link
Copy Markdown

DocAI-HuggingFaces-Rs: A Rust Library for Document AI with Hugging Face Models

Introduction

This pull request introduces DocAI-HuggingFaces-Rs, a new Rust library designed for Document AI tasks using models accessible through Hugging Face. The library focuses on tasks related to document analysis and integrates seamlessly with the WasmEdge WASI-NN environment.

Library Structure

The library includes task APIs with three main types:

  1. XxxBuilder: Used to create task instances with various configuration options.
  2. Xxx: Represents a task instance containing essential task and model information.
  3. XxxSession: A running session for carrying out pre-processing, inference, and post-processing, along with the capability to store intermediate results.

Available Tasks

DocAI-HuggingFaces-Rs currently supports Document Classification, which includes the following components:

  • DocumentClassifierBuilder: Create a task instance.
  • DocumentClassifier: The task instance with key task and model details.
  • DocumentClassifierSession: A running session for managing pre-processing, inference, and post-processing.

Examples

The pull request provides comprehensive code examples that demonstrate the library's functionality, including document classification. DocAI-HuggingFaces-Rs showcases superior performance and user-friendliness, making it an ideal choice for Document AI tasks, especially when combined with the WasmEdge WASI-NN environment.

Acknowledgments

This contribution is made possible through collaboration with Microsoft's work on Hugging Faces and the dedicated efforts of yanghaku in developing WasmEdge/mediapipe-rs.

Objectives

This PR introduces a powerful Rust library designed to simplify Document AI tasks using Hugging Face models. It extends the capabilities of WasmEdge's WASI-NN environment, making it easier than ever to perform document analysis and processing.

Contributor: Sarrah Bastawala sarrah.basta@gmail.com

…ntegration (#1)

Added an initial commit for the Rust library, "DocAI-HuggingFaces-Rs," which introduces a powerful Document Classification task. The commit includes the following updates:

- Implemented a working example for document classification.
- Corrected the Cargo.toml file.
- Added shell scripts for easy installation and running examples, with support for displaying formatted output results for classification.
- Cleaned up the code and addressed warnings while allowing for future code extensions.
- Included credits and further code cleanup.
- Updated the script to use the release tarball instead of the master branch for building from source.
- Updated the repository name to match the project's focus.

Signed-off-by: Sarrah Bastawala <sarrah.basta@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant