Update scripts/README.md
Browse files- scripts/README.md +16 -3
scripts/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
# Document Parsing Models - Inference Guide
|
| 2 |
## Overview
|
| 3 |
-
The scripts in this folder
|
| 4 |
-
Each service follows a standard installation procedure and provides an infer_
|
| 5 |
|
| 6 |
-
You can choose from document parsing products such as **Upstage DP**, **AWS Textract**, **Google Document AI**, **Microsoft Azure Form Recognizer**, **LlamaParse**, or **Unstructured**.
|
|
|
|
| 7 |
|
| 8 |
Each service generates a JSON output file in a consistent format.
|
| 9 |
You can find detailed information about the output format [here](https://github.com/UpstageAI/document-parse-benchmark-private?tab=readme-ov-file#dataset-format).
|
|
@@ -13,6 +14,8 @@ You can find detailed information about the output format [here](https://github.
|
|
| 13 |
|
| 14 |
Follow the [official Upstage DP Documentation](https://developers.upstage.ai/docs/apis/document-parse) to set up Upstage for Document Parsing.
|
| 15 |
|
|
|
|
|
|
|
| 16 |
Use the script below to make an inference:
|
| 17 |
```
|
| 18 |
$ python infer_upstage.py \
|
|
@@ -32,6 +35,8 @@ $ pip install boto3
|
|
| 32 |
```
|
| 33 |
Refer to the [AWS Textract Documentation](https://docs.aws.amazon.com/en_us/textract/latest/dg/getting-started.html) for detailed instructions.
|
| 34 |
|
|
|
|
|
|
|
| 35 |
Use the script below to make an inference:
|
| 36 |
```
|
| 37 |
$ python infer_aws.py \
|
|
@@ -53,6 +58,8 @@ $ pip install google-cloud-documentai
|
|
| 53 |
|
| 54 |
More information can be found in the [Google Document AI Documentation](https://console.cloud.google.com/ai/document-ai?hl=en)
|
| 55 |
|
|
|
|
|
|
|
| 56 |
Use the script below to make an inference:
|
| 57 |
```
|
| 58 |
$ python infer_google.py \
|
|
@@ -63,6 +70,8 @@ $ python infer_google.py \
|
|
| 63 |
## LlamaParse
|
| 64 |
Refer to the [official LlamaParse Documentation](https://docs.cloud.llamaindex.ai/category/API/parsing) to install and use LlamaParse for document analysis.
|
| 65 |
|
|
|
|
|
|
|
| 66 |
Use the script below to make an inference:
|
| 67 |
```
|
| 68 |
$ python infer_llamaparse.py \
|
|
@@ -77,6 +86,8 @@ $ pip install azure-ai-formrecognizer==3.3.0
|
|
| 77 |
```
|
| 78 |
See the [Microsoft Azure Form Recognizer Documentation](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/quickstarts/get-started-sdks-rest-api?view=doc-intel-3.0.0&preserve-view=true&pivots=programming-language-python) for additional details.
|
| 79 |
|
|
|
|
|
|
|
| 80 |
Use the script below to make an inference:
|
| 81 |
```
|
| 82 |
$ python infer_microsoft.py \
|
|
@@ -96,6 +107,8 @@ $ apt install tesseract-ocr-[lang] # use an appropriate language code
|
|
| 96 |
```
|
| 97 |
Detailed installation instructions can be found [here](https://unstructured-io.github.io/unstructured/installing.html). Use [Tesseract Language Codes](https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html) for OCR support in different languages.
|
| 98 |
|
|
|
|
|
|
|
| 99 |
Use the script below to make an inference:
|
| 100 |
```
|
| 101 |
$ python infer_unstructured.py \
|
|
|
|
| 1 |
# Document Parsing Models - Inference Guide
|
| 2 |
## Overview
|
| 3 |
+
The scripts in this folder allow users to extract structured data from unstructured documents using different document parsing services and libraries.
|
| 4 |
+
Each service follows a standard installation procedure and provides an `infer_*` script to perform inference on PDF or Image samples.
|
| 5 |
|
| 6 |
+
You can choose from document parsing products such as **Upstage DP**, **AWS Textract**, **Google Document AI**, **Microsoft Azure Form Recognizer**, **LlamaParse**, or **Unstructured**.
|
| 7 |
+
Most of these services require an API key for access, so ensure you follow specific setup instructions for each product to configure the environment correctly.
|
| 8 |
|
| 9 |
Each service generates a JSON output file in a consistent format.
|
| 10 |
You can find detailed information about the output format [here](https://github.com/UpstageAI/document-parse-benchmark-private?tab=readme-ov-file#dataset-format).
|
|
|
|
| 14 |
|
| 15 |
Follow the [official Upstage DP Documentation](https://developers.upstage.ai/docs/apis/document-parse) to set up Upstage for Document Parsing.
|
| 16 |
|
| 17 |
+
**Note:** Ensure that the `UPSTAGE_ENDPOINT` and `UPSTAGE_API_KEY` variables are set up to run the code.
|
| 18 |
+
|
| 19 |
Use the script below to make an inference:
|
| 20 |
```
|
| 21 |
$ python infer_upstage.py \
|
|
|
|
| 35 |
```
|
| 36 |
Refer to the [AWS Textract Documentation](https://docs.aws.amazon.com/en_us/textract/latest/dg/getting-started.html) for detailed instructions.
|
| 37 |
|
| 38 |
+
**Note:** To run the AWS inference code, you need to set the following variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, and `AWS_S3_BUCKET_NAME`.
|
| 39 |
+
|
| 40 |
Use the script below to make an inference:
|
| 41 |
```
|
| 42 |
$ python infer_aws.py \
|
|
|
|
| 58 |
|
| 59 |
More information can be found in the [Google Document AI Documentation](https://console.cloud.google.com/ai/document-ai?hl=en)
|
| 60 |
|
| 61 |
+
**Note:** To run the Google inference code, you need to set the following variables: `GOOGLE_PROJECT_ID`, `GOOGLE_PROCESSOR_ID`, `GOOGLE_LOCATION`, and `GOOGLE_ENDPOINT`.
|
| 62 |
+
|
| 63 |
Use the script below to make an inference:
|
| 64 |
```
|
| 65 |
$ python infer_google.py \
|
|
|
|
| 70 |
## LlamaParse
|
| 71 |
Refer to the [official LlamaParse Documentation](https://docs.cloud.llamaindex.ai/category/API/parsing) to install and use LlamaParse for document analysis.
|
| 72 |
|
| 73 |
+
**Note:** Ensure that the `LLAMAPARSE_API_KEY`, `LLAMAPARSE_POST_URL`, and `LLAMAPARSE_GET_URL` variables are set before running the code.
|
| 74 |
+
|
| 75 |
Use the script below to make an inference:
|
| 76 |
```
|
| 77 |
$ python infer_llamaparse.py \
|
|
|
|
| 86 |
```
|
| 87 |
See the [Microsoft Azure Form Recognizer Documentation](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/quickstarts/get-started-sdks-rest-api?view=doc-intel-3.0.0&preserve-view=true&pivots=programming-language-python) for additional details.
|
| 88 |
|
| 89 |
+
**Note:** Set the `MICROSOFT_API_KEY` and `MICROSOFT_ENDPOINT` variables before running the code.
|
| 90 |
+
|
| 91 |
Use the script below to make an inference:
|
| 92 |
```
|
| 93 |
$ python infer_microsoft.py \
|
|
|
|
| 107 |
```
|
| 108 |
Detailed installation instructions can be found [here](https://unstructured-io.github.io/unstructured/installing.html). Use [Tesseract Language Codes](https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html) for OCR support in different languages.
|
| 109 |
|
| 110 |
+
**Note:** To run the Unstructured inference code, you must set the `UNSTRUCTURED_API_KEY` and `UNSTRUCTURED_URL` variables.
|
| 111 |
+
|
| 112 |
Use the script below to make an inference:
|
| 113 |
```
|
| 114 |
$ python infer_unstructured.py \
|