-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdefault_v2.txt
More file actions
43 lines (34 loc) · 1.04 KB
/
Copy pathdefault_v2.txt
File metadata and controls
43 lines (34 loc) · 1.04 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
<?php
use Mindee\ClientV2;
use Mindee\Input\InferenceParameters;
use Mindee\Input\PathInput;
$apiKey = "MY_API_KEY";
$filePath = "/path/to/the/file.ext";
$modelId = "MY_MODEL_ID";
// Init a new client
$mindeeClient = new ClientV2($apiKey);
// Set inference parameters
// Note: modelId is mandatory.
$inferenceParams = new InferenceParameters(
// ID of the model, required.
$modelId,
// Options: set to `true` or `false` to override defaults
// Enhance extraction accuracy with Retrieval-Augmented Generation.
false,
// Extract the full text content from the document as strings.
false,
// Calculate bounding box polygons for all fields.
false,
// Boost the precision and accuracy of all extractions.
// Calculate confidence scores for all fields.
false
);
// Load a file from disk
$inputSource = new PathInput($filePath);
// Upload the file
$response = $mindeeClient->enqueueAndGetInference(
$inputSource,
$inferenceParams
);
// Print a summary of the response
echo strval($response->inference);