Skip to content

Commit 6432ee2

Browse files
committed
feat: update guideline
1 parent ea9fe9f commit 6432ee2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

integration/got-ocr2.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Extension Manager and GOT-OCR2.0 Loader
2+
3+
## Key Features
4+
5+
### 1. **GOCR2 as Image Reader**
6+
7+
- **GOCR2ImageReader** is a new class designed to read images using the [**GOCR-2.0** OCR engine](https://github.com/Ucas-HaoranWei/GOT-OCR2.0).
8+
- This reader is initialized with an endpoint that defaults to `http://localhost:8881/ai/infer/` for the OCR service, but can be configured through an environment variable `GOCR2_ENDPOINT` or passed explicitly.
9+
- It uses exponential backoff retry mechanisms to ensure robustness during API calls.
10+
- Supports loading image files and extracting their text content, returning structured document data.
11+
12+
#### Setup
13+
14+
- We provide the docker image, with fastapi for serving the GOT-OCR2.0. Pull the image from:
15+
16+
```bash
17+
docker run -d --gpus all -p 8881:8881 ghcr.io/phv2312/got-ocr2.0:main
18+
```
19+
20+
- Detail implementation is placed at [ocr_loader.py](/libs/kotaemon/kotaemon/loaders/ocr_loader.py)
21+
22+
### 2. **Extension Manager**
23+
24+
- ExtensionManager allows users to dynamically manage multiple loaders for different file types.
25+
26+
- Users can switch between multiple loaders for the same file extension, such as using the GOCR2ImageReader or a
27+
different unstructured data parser for .png files. This provides the flexibility to choose the best-suited loader for the task at hand.
28+
29+
- To change the default loader, go to **Settings**, then **Extension settings**. It displays a grid of extensions and
30+
its supported loaders. Any modification will be saved to DB as other settings do.

0 commit comments

Comments
 (0)