-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathv2_extraction.txt
More file actions
44 lines (36 loc) · 1.02 KB
/
v2_extraction.txt
File metadata and controls
44 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from mindee import (
ClientV2,
InferenceParameters,
InferenceResponse,
PathInput,
)
input_path = "/path/to/the/file.ext"
api_key = "MY_API_KEY"
model_id = "MY_MODEL_ID"
# Init a new client
mindee_client = ClientV2(api_key)
# Set inference parameters
params = InferenceParameters(
# ID of the model, required.
model_id=model_id,
# Options: set to `True` or `False` to override defaults
# Enhance extraction accuracy with Retrieval-Augmented Generation.
rag=None,
# Extract the full text content from the document as strings.
raw_text=None,
# Calculate bounding box polygons for all fields.
polygon=None,
# Boost the precision and accuracy of all extractions.
# Calculate confidence scores for all fields.
confidence=None,
)
# Load a file from disk
input_source = PathInput(input_path)
# Send for processing
response = mindee_client.enqueue_and_get_result(
InferenceResponse,
input_source,
params,
)
# Print a brief summary of the parsed data
print(response.inference)