Document
in package
implements
Stringable
Base class for all predictions.
Table of Contents
Interfaces
- Stringable
Properties
- $extras : Extras|null
- $filename : string
- $id : string
- $inference : Inference|string
- $nPages : int
- $ocr : Ocr|null
Methods
- __construct() : mixed
- __toString() : string
- injectFullTextOcr() : void
- Injects the results from pages' "full_text_ocr", if present.
Properties
$extras
public
Extras|null
$extras
Potential Extras fields sent back along with the prediction.
$filename
public
string
$filename
Name of the input document.
$id
public
string
$id
ID of the document as sent back by the server.
$inference
public
Inference|string
$inference
Result of the base inference.
$nPages
public
int
$nPages
Amount of pages in the document
$ocr
public
Ocr|null
$ocr
Potential raw text results read by the Ocr (limited feature)
Methods
__construct()
public
__construct(string $predictionType, array<string, int|float|string|bool|null|array<string|int, mixed>> $rawResponse) : mixed
Parameters
- $predictionType : string
-
Type of prediction.
- $rawResponse : array<string, int|float|string|bool|null|array<string|int, mixed>>
-
Raw HTTP response.
Tags
__toString()
public
__toString() : string
Return values
string —String representation.
injectFullTextOcr()
Injects the results from pages' "full_text_ocr", if present.
private
injectFullTextOcr(array<string, int|float|string|bool|null|array<string|int, mixed>> $rawResponse) : void
Parameters
- $rawResponse : array<string, int|float|string|bool|null|array<string|int, mixed>>
-
Raw HTTP response.