Skip to content

Commit 93c59fb

Browse files
adithya-s-kgitbook-bot
authored andcommitted
GITBOOK-5: No subject
1 parent e0662bc commit 93c59fb

File tree

7 files changed

+366
-157
lines changed

7 files changed

+366
-157
lines changed

docs/README.md

Lines changed: 280 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
---
2-
description: >-
3-
OmniParse is a comprehensive ingestion and parsing tool designed to convert
4-
any unstructured document, media, or website into structred markdown
52
cover: .gitbook/assets/Twitter header - 1.png
63
coverY: 0
74
layout:
@@ -22,28 +19,296 @@ layout:
2219

2320
# OmniPrase
2421

22+
 [![GitHub Stars](https://img.shields.io/github/stars/adithya-s-k/omniparse?style=social)](https://github.com/adithya-s-k/omniparse/stargazers) [![GitHub Forks](https://img.shields.io/github/forks/adithya-s-k/omniparse?style=social)](https://github.com/adithya-s-k/omniparse/network/members) [![GitHub Issues](https://img.shields.io/github/issues/adithya-s-k/omniparse)](https://github.com/adithya-s-k/omniparse/issues) [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/adithya-s-k/omniparse)](https://github.com/adithya-s-k/omniparse/pulls) [![License](https://img.shields.io/github/license/adithya-s-k/omniparse)](../LICENSE)
23+
24+
> **OmniParse is a platform that ingests/parses any unstructured data into structured, actionable data optimized for GenAI (LLM) applcaitons. Whether working with documents, tables, images, videos, audio files, or web pages, OmniParse prepares your data to be clean, structured and ready for AI applications, such as RAG , fine-tuning and more.**
25+
26+
### Try it out
27+
28+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adithya-s-k/omniparse/blob/main/examples/OmniParse\_GoogleColab.ipynb) Gradio and NextJS interactive demo coming soon
29+
30+
### Features
31+
32+
✅ Completely local, no external APIs\
33+
✅ Fits in a T4 GPU\
34+
✅ Supports 10+ file types\
35+
✅ Convert documents, multimedia, and web pages to high-quality structured markdown\
36+
✅ Table extraction, image extraction/captioning, audio/video transcription, web page crawling\
37+
✅ Easily deployable using Docker and Skypilot\
38+
✅ Colab friendly
39+
40+
#### Problem Statement
41+
42+
It's challenging to process data as it comes in different shapes and sizes. OmniParse aims to be an ingestion/parsing platform where you can ingest any type of data, such as documents, images, audio, video, and web content, and get the most structured and actionable output that is GenAI (LLM) friendly.
43+
2544
| Original PDF | Marker-API | PyPDF |
2645
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2746
| [![Original PDF](https://github.com/adithya-s-k/marker-api/raw/master/data/images/original\_pdf.png)](https://github.com/adithya-s-k/marker-api/blob/master/data/images/original\_pdf.png) | [![Marker-API](https://github.com/adithya-s-k/marker-api/raw/master/data/images/marker\_api.png)](https://github.com/adithya-s-k/marker-api/blob/master/data/images/marker\_api.png) | [![PyPDF](https://github.com/adithya-s-k/marker-api/raw/master/data/images/pypdf.png)](https://github.com/adithya-s-k/marker-api/blob/master/data/images/pypdf.png) |
2847

29-
### Features
48+
### Installation
3049

31-
✅ Supports 10+ file types\
32-
✅ Convert Documents, Multimedia, Web pages to high-quality structured markdown\
33-
✅ Table Extraction, Image Extraction/Captioning, Audio/Video Transcription, Web page Crawling\
34-
✅ Easily Deployable using Docker and Skypilot\
35-
✅ CPU/GPU compatible\
36-
✅ Batch processing for handling multiple files at once\
37-
✅ Comprehensive logging and error handling for robust performance 
50+
> Note: The server only works on Linux-based systems. This is due to certain dependencies and system-specific configurations that are not compatible with Windows or macOS. To install OmniParse, you can use `pip`:
51+
52+
```bash
53+
git clone https://github.com/adithya-s-k/omniparse
54+
cd omniparse
55+
```
56+
57+
Create a Virtual Environment:
58+
59+
```bash
60+
conda create --name omniparse-venv python=3.10
61+
conda activate omniparse-venv
62+
```
63+
64+
Install Dependencies:
65+
66+
```bash
67+
poetry install
68+
# or
69+
pip install -e .
70+
```
71+
72+
#### 🛳️ Docker
73+
74+
To use OmniParse with Docker, execute the following commands:
75+
76+
1. Pull the OmniParse API Docker image from Docker Hub:
77+
2. Run the Docker container, exposing port 8000: 👉🏼[Docker Image](https://hub.docker.com/r/savatar101/omniparse)
78+
79+
```bash
80+
docker pull savatar101/omniparse:0.1
81+
# if you are running on a gpu
82+
docker run --gpus all -p 8000:8000 savatar101/omniparse:0.1
83+
# else
84+
docker run -p 8000:8000 savatar101/omniparse:0.1
85+
```
86+
87+
Alternatively, if you prefer to build the Docker image locally: Then, run the Docker container as follows:
88+
89+
```bash
90+
docker build -t omniparse .
91+
# if you are running on a gpu
92+
docker run --gpus all -p 8000:8000 omniparse
93+
# else
94+
docker run -p 8000:8000 omniparse
95+
96+
```
97+
98+
### Usage
99+
100+
Run the Server:
38101

39-
### Supported Inputs
102+
```bash
103+
python server.py --host 0.0.0.0 --port 8000 --documents --media --web
104+
```
105+
106+
* `--documents`: Load in all the models that help you parse and ingest documents (Surya OCR series of models and Florence-2).
107+
* `--media`: Load in Whisper model to transcribe audio and video files.
108+
* `--web`: Set up selenium crawler.
109+
110+
### Running the Server
111+
112+
To start the API server, run the following command:
113+
114+
```
115+
python main.py --host 0.0.0.0 --port 8000
116+
```
117+
118+
Arguments:
119+
120+
* `--host`: Host IP address (default: 0.0.0.0)
121+
* `--port`: Port number (default: 8000)
122+
123+
### Supported Data Types
40124

41125
| Type | Supported Extensions |
42126
| --------- | ------------------------------------- |
43-
| Documents | .doc, .docx, .epub, .pdf, .ppt, .pptx |
127+
| Documents | .doc, .docx, .odt, .pdf, .ppt, .pptx |
44128
| Images | .png, .jpg, .jpeg, .tiff, .bmp, .heic |
45129
| Video | .mp4, .mkv, .avi, .mov |
46130
| Audio | .mp3, .wav, .aac |
47-
| Web | http://\<anydomain>.com |
48-
| Crawl | http://\<anydomain>.com |
131+
| Web | dynamic webpages, http://.com |
132+
133+
<details>
134+
135+
<summary>API Endpoints</summary>
136+
137+
Client library compatible with Langchain, llamaindex, and haystack integrations coming soon.
138+
139+
* API Endpoints
140+
* Document Parsing
141+
* Parse Any Document
142+
* Parse PDF
143+
* Parse PowerPoint
144+
* Parse Word Document
145+
* Media Parsing
146+
* Parse Any Media
147+
* Parse Image
148+
* Process Image
149+
* Parse Video
150+
* Parse Audio
151+
* Website Parsing
152+
* Parse Website
153+
154+
#### Document Parsing
155+
156+
**Parse Any Document**
157+
158+
Endpoint: `/parse_document` Method: POST
159+
160+
Parses PDF, PowerPoint, or Word documents.
161+
162+
Curl command:
163+
164+
```
165+
curl -X POST -F "file=@/path/to/document" http://localhost:8000/parse_document
166+
```
167+
168+
**Parse PDF**
169+
170+
Endpoint: `/parse_document/pdf` Method: POST
171+
172+
Parses PDF documents.
173+
174+
Curl command:
175+
176+
```
177+
curl -X POST -F "file=@/path/to/document.pdf" http://localhost:8000/parse_document/pdf
178+
```
179+
180+
**Parse PowerPoint**
181+
182+
Endpoint: `/parse_document/ppt` Method: POST
183+
184+
Parses PowerPoint presentations.
185+
186+
Curl command:
187+
188+
```
189+
curl -X POST -F "file=@/path/to/presentation.ppt" http://localhost:8000/parse_document/ppt
190+
```
191+
192+
**Parse Word Document**
193+
194+
Endpoint: `/parse_document/docs` Method: POST
195+
196+
Parses Word documents.
197+
198+
Curl command:
199+
200+
```
201+
curl -X POST -F "file=@/path/to/document.docx" http://localhost:8000/parse_document/docs
202+
```
203+
204+
#### Media Parsing
205+
206+
**Parse Image**
207+
208+
Endpoint: `/parse_media/image` Method: POST
209+
210+
Parses image files (PNG, JPEG, JPG, TIFF, WEBP).
211+
212+
Curl command:
213+
214+
```
215+
curl -X POST -F "file=@/path/to/image.jpg" http://localhost:8000/parse_media/image
216+
```
217+
218+
**Process Image**
219+
220+
Endpoint: `/parse_media/process_image` Method: POST
221+
222+
Processes an image with a specific task.
223+
224+
Possible task inputs: `OCR | OCR with Region | Caption | Detailed Caption | More Detailed Caption | Object Detection | Dense Region Caption | Region Proposal`
225+
226+
Curl command:
227+
228+
```
229+
curl -X POST -F "image=@/path/to/image.jpg" -F "task=Caption" -F "prompt=Optional prompt" http://localhost:8000/parse_media/process_image
230+
```
231+
232+
Arguments:
233+
234+
* `image`: The image file
235+
* `task`: The processing task (e.g., Caption, Object Detection)
236+
* `prompt`: Optional prompt for certain tasks
237+
238+
**Parse Video**
239+
240+
Endpoint: `/parse_media/video` Method: POST
241+
242+
Parses video files (MP4, AVI, MOV, MKV).
243+
244+
Curl command:
245+
246+
```
247+
curl -X POST -F "file=@/path/to/video.mp4" http://localhost:8000/parse_media/video
248+
```
249+
250+
**Parse Audio**
251+
252+
Endpoint: `/parse_media/audio` Method: POST
253+
254+
Parses audio files (MP3, WAV, FLAC).
255+
256+
Curl command:
257+
258+
```
259+
curl -X POST -F "file=@/path/to/audio.mp3" http://localhost:8000/parse_media/audio
260+
```
261+
262+
#### Website Parsing
263+
264+
**Parse Website**
265+
266+
Endpoint: `/parse_website` Method: POST
267+
268+
Parses a website given its URL.
269+
270+
Curl command:
271+
272+
```
273+
curl -X POST -H "Content-Type: application/json" -d '{"url": "https://example.com"}' http://localhost:8000/parse_website
274+
```
275+
276+
Arguments:
277+
278+
* `url`: The URL of the website to parse
279+
280+
</details>
281+
282+
### Coming Soon/ RoadMap
283+
284+
🦙 LlamaIndex | Langchain | Haystack integrations coming soon 📚 Batch processing data ⭐ Dynamic chunking and structured data extraction based on specified Schema\
285+
🛠️ One magic API: just feed in your file prompt what you want, and we will take care of the rest\
286+
🔧 Dynamic model selection and support for external APIs\
287+
📄 Batch processing for handling multiple files at once\
288+
📦 New open-source model to replace Surya OCR and Marker
289+
290+
**Final goal**: replace all the different models currently being used with a single MultiModel Model to parse any type of data and get the data you need.
291+
292+
### License
293+
294+
OmniParse is licensed under the GPL-3.0 license. See `LICENSE` for more information.
295+
296+
### Acknowledgements
297+
298+
This project builds upon the remarkable [Marker](https://github.com/VikParuchuri/marker) project created by [Vik Paruchuri](https://twitter.com/VikParuchuri). We express our gratitude for the inspiration and foundation provided by this project. Special thanks to [Surya-OCR](https://github.com/VikParuchuri/surya) and [Texify](https://github.com/VikParuchuri/texify) for the OCR models extensively used in this project, and to [Crawl4AI](https://github.com/unclecode/crawl4ai) for their contributions.
299+
300+
Models being used:
301+
302+
* Surya OCR, Detect, Layout, Order, and Texify
303+
* Florence-2 base
304+
* Whisper Small
305+
306+
Thank you to the authors for their contributions to these models.
307+
308+
***
309+
310+
### Contact
311+
312+
[![Star History Chart](https://api.star-history.com/svg?repos=adithya-s-k/omniparse-api\&type=Date)](https://adithyask.com)
49313

314+
For any inquiries, please contact us at adithyaskolavi@gmail.com

docs/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Table of contents
22

33
* [OmniPrase](README.md)
4-
* [Quick Start](quick-start.md)
54
* [Installation](installation.md)
65
* [Deployment](deployment.md)
76
* [Integration](integration.md)

0 commit comments

Comments
 (0)