Document
in package
Base class for all predictions.
Table of Contents
Properties
- $extras : Extras|null
- $filename : string|mixed
- $id : string|mixed
- $inference : Inference|object|string
- $nPages : int|mixed
- $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|mixed
$filename
Name of the input document.
$id
public
string|mixed
$id
ID of the document as sent back by the server.
$inference
public
Inference|object|string
$inference
Result of the base inference.
$nPages
public
int|mixed
$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, mixed> $rawResponse) : mixed
Parameters
- $predictionType : string
-
Type of prediction.
- $rawResponse : 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, mixed> $rawResponse) : void
Parameters
- $rawResponse : array<string|int, mixed>
-
Raw HTTP response.