Common Fields
Documents
Document
- class Document(inference_type, raw_response)
Base class for all predictions.
-
extras:
Optional
[Extras
] Potential Extras fields sent back along the prediction
-
filename:
str
Name of the input document
-
id:
str
Id of the document as sent back by the server
-
inference:
Inference
[TypeVar
(TypePrediction
, bound=Prediction
),TypeVar
(TypePage
, bound=Page
)] Result of the base inference
-
n_pages:
int
Amount of pages in the document
-
extras:
Page
- class Page(prediction_type, raw_prediction)
Base Page object for predictions.
-
id:
int
Id of the current page.
-
orientation:
Optional
[OrientationField
] Orientation of the page
-
prediction:
TypeVar
(TypePrediction
, bound=Prediction
) Type of Page prediction.
-
id:
Page Fields
Orientation
- class OrientationField(raw_prediction, value_key='value', reconstructed=False, page_id=None)
The clockwise rotation to apply (in degrees) to make the image upright.
- Parameters:
raw_prediction (Dict[str, Any]) –
value_key (str) –
reconstructed (bool) –
page_id (Optional[int]) –
-
value:
int
Degrees as an integer.
API
ApiRequest
ApiResponse
- class ApiResponse(raw_response)
Base class for responses sent by the server.
Serves as a base class for responses to both synchronous and asynchronous calls.
- Parameters:
raw_response (Dict[str, Any]) –
-
api_request:
ApiRequest
Results of the request sent to the API.
- property raw_http: str
Displays the result of the raw response as json string.
Prediction
- class Prediction(raw_prediction, page_id=None)
Base Prediction class.
- Parameters:
raw_prediction (Dict[str, Any]) –
page_id (Optional[int]) –
Asynchronous Parsing
AsyncPredictResponse
Job
- class Job(json_response)
Job class for asynchronous requests.
Will hold information on the queue a document has been submitted to.
- Parameters:
json_response (dict) –
-
available_at:
Optional
[datetime
] Timestamp of the request after it has been completed.
-
error:
Optional
[Dict
[str
,Any
]] Information about an error that occurred during the job processing.
-
id:
str
ID of the job sent by the API in response to an enqueue request.
-
issued_at:
datetime
Timestamp of the request reception by the API.
-
millisecs_taken:
int
Time (ms) taken for the request to be processed by the API.
-
status:
str
Status of the request, as seen by the API.
Miscellaneous Parsing
FeedbackResponse
- class FeedbackResponse(server_response)
Wrapper for feedback response.
- Parameters:
server_response (Dict[str, Any]) –
OCR Extraction
OCR
MVisionV1
OcrPage
OcrLine
OcrWord
- class OcrWord(raw_prediction)
A single word.
- Parameters:
raw_prediction (Dict[str, Any]) –
- bounding_box: Optional[Quadrilateral]
A right rectangle containing the word in the document.
-
confidence:
float
The confidence score.
- polygon: Polygon
A polygon containing the word in the document.
-
text:
str
The extracted text.