File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from mindee import ClientV2, SplitParameters, SplitResponse, PathInput
1+ from mindee import (
2+ ClientV2,
3+ PathInput,
4+ SplitParameters,
5+ SplitResponse,
6+ )
27
38input_path = "/path/to/the/file.ext"
49api_key = "MY_API_KEY"
@@ -7,7 +12,7 @@ model_id = "MY_SPLIT_MODEL_ID"
712# Init a new client
813mindee_client = ClientV2(api_key)
914
10- # Set inference parameters
15+ # Set parameters
1116params = SplitParameters(
1217 # ID of the model, required.
1318 model_id=model_id,
@@ -16,7 +21,7 @@ params = SplitParameters(
1621# Load a file from disk
1722input_source = PathInput(input_path)
1823
19- # Send for processing
24+ # Send for processing using polling
2025response = mindee_client.enqueue_and_get_result(
2126 SplitResponse,
2227 input_source,
@@ -25,3 +30,6 @@ response = mindee_client.enqueue_and_get_result(
2530
2631# Print a brief summary of the parsed data
2732print(response.inference)
33+
34+ # Access the split result
35+ splits: list = response.inference.result.splits
You can’t perform that action at this time.
0 commit comments