Skip to content

Module Output

This page explains the output of each module.

Document Analyzer

The Document Analyzer Module outputs the following variables as a tuple.

Variable Name Type Description
results DocumentAnalyzerSchema Module output results
ocr_vis np.ndarray | None Visualization of the output of the AI-OCR (Only when visualizer=True)
layout_vis np.ndarray | None Visualization of the output of the Layout Analyzer (Only when visualizer=True)

The specification for the DocumentAnalyzerSchema that the results variable conforms to is as follows:

DocumentAnalyzerSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
paragraphs List of detected paragraphs
Requiredarray
#
List of detected paragraphs
Type
array
Nested fields
ParagraphSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the paragraph in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the paragraph in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
contents Text content of the paragraph
RequiredanyOf
#
Text content of the paragraph
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
direction Text direction, e.g., ['horizontal' or 'vertical']
RequiredanyOf
#
Text direction, e.g., ['horizontal' or 'vertical']
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
order Order of the paragraph in the document
RequiredanyOf
#
Order of the paragraph in the document
Type
anyOf
Nested fields
Any of 1
integer
#
Any of 2
null
#
role Role of the paragraph, e.g., ['section_headings', 'page_header', 'page_footer'])
RequiredanyOf
#
Role of the paragraph, e.g., ['section_headings', 'page_header', 'page_footer'])
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
tables List of detected tables
Requiredarray
#
List of detected tables
Type
array
Nested fields
TableStructureRecognizerSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
n_row Number of rows in the table
Requiredinteger
#
Number of rows in the table
Type
integer
n_col Number of columns in the table
Requiredinteger
#
Number of columns in the table
Type
integer
rows List of table lines representing rows
Requiredarray
#
List of table lines representing rows
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
cols List of table lines representing columns
Requiredarray
#
List of table lines representing columns
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
spans List of table lines representing spans
Requiredarray
#
List of table lines representing spans
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
cells List of table cells
Requiredarray
#
List of table cells
Type
array
Nested fields
TableCellSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
col Column index of the cell
Requiredinteger
#
Column index of the cell
Type
integer
row Row index of the cell
Requiredinteger
#
Row index of the cell
Type
integer
col_span Number of columns spanned by the cell
Requiredinteger
#
Number of columns spanned by the cell
Type
integer
row_span Number of rows spanned by the cell
Requiredinteger
#
Number of rows spanned by the cell
Type
integer
box Bounding box of the cell in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the cell in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
contents Text content of the cell
RequiredanyOf
#
Text content of the cell
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
order Order of the table in the document
Requiredinteger
#
Order of the table in the document
Type
integer
words List of recognized words
Requiredarray
#
List of recognized words
Type
array
Nested fields
WordPrediction
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
points Bounding box of the word in the format [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
Requiredarray
#
Bounding box of the word in the format [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
ArrayItem
array
#
Type
array
Constraints
  • Minimum items: 2
  • Maximum items: 2
Nested fields
Item
integer
#
content Text content of the word
Requiredstring
#
Text content of the word
Type
string
direction Text direction, e.g., 'horizontal' or 'vertical'
Requiredstring
#
Text direction, e.g., 'horizontal' or 'vertical'
Type
string
rec_score Confidence score of the word recognition
Requirednumber
#
Confidence score of the word recognition
Type
number
det_score Confidence score of the word detection
Requirednumber
#
Confidence score of the word detection
Type
number
figures List of detected figures
Requiredarray
#
List of detected figures
Type
array
Nested fields
FigureSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the figure in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the figure in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
order Order of the figure in the document
RequiredanyOf
#
Order of the figure in the document
Type
anyOf
Nested fields
Any of 1
integer
#
Any of 2
null
#
paragraphs List of paragraphs associated with the figure
Requiredarray
#
List of paragraphs associated with the figure
Type
array
Nested fields
ParagraphSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the paragraph in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the paragraph in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
contents Text content of the paragraph
RequiredanyOf
#
Text content of the paragraph
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
direction Text direction, e.g., ['horizontal' or 'vertical']
RequiredanyOf
#
Text direction, e.g., ['horizontal' or 'vertical']
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
order Order of the paragraph in the document
RequiredanyOf
#
Order of the paragraph in the document
Type
anyOf
Nested fields
Any of 1
integer
#
Any of 2
null
#
role Role of the paragraph, e.g., ['section_headings', 'page_header', 'page_footer'])
RequiredanyOf
#
Role of the paragraph, e.g., ['section_headings', 'page_header', 'page_footer'])
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
direction Text direction, e.g., ['horizontal' or 'vertical']
RequiredanyOf
#
Text direction, e.g., ['horizontal' or 'vertical']
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#

AI-OCR

The AI-OCR module outputs the following variables as a tuple.

Variable Name Type Description
results OCRSchema Module output results
ocr_vis np.ndarray | None Visualization of the output of the AI-OCR (Only when visualizer=True)

The specification for the OCRSchema that the results variable conforms to is as follows:

OCRSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
words List of recognized words with their bounding boxes, content, direction, and scores
Requiredarray
#
List of recognized words with their bounding boxes, content, direction, and scores
Type
array
Nested fields
WordPrediction
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
points Bounding box of the word in the format [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
Requiredarray
#
Bounding box of the word in the format [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
ArrayItem
array
#
Type
array
Constraints
  • Minimum items: 2
  • Maximum items: 2
Nested fields
Item
integer
#
content Text content of the word
Requiredstring
#
Text content of the word
Type
string
direction Text direction, e.g., 'horizontal' or 'vertical'
Requiredstring
#
Text direction, e.g., 'horizontal' or 'vertical'
Type
string
rec_score Confidence score of the word recognition
Requirednumber
#
Confidence score of the word recognition
Type
number
det_score Confidence score of the word detection
Requirednumber
#
Confidence score of the word detection
Type
number

Layout Analyzer

The Layout Analyzer module outputs the following variables as a tuple.

Variable Name Type Description
results LayoutAnalyzerSchema Module output results
layout_vis np.ndarray | None Visualization of the output of the Layout Analyzer (Only when visualizer=True)

The specification for the LayoutAnalyzerSchema that the results variable conforms to is as follows:

LayoutAnalyzerSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
paragraphs List of detected paragraphs
Requiredarray
#
List of detected paragraphs
Type
array
Nested fields
Element
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the layout element in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the layout element in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the layout element detection
Requirednumber
#
Confidence score of the layout element detection
Type
number
role Role of the element, e.g., ['section_headings', 'page_header', 'page_footer', 'list_item', 'caption', 'inline_formula', 'display_formula', 'index']
RequiredanyOf
#
Role of the element, e.g., ['section_headings', 'page_header', 'page_footer', 'list_item', 'caption', 'inline_formula', 'display_formula', 'index']
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
tables List of detected tables
Requiredarray
#
List of detected tables
Type
array
Nested fields
TableStructureRecognizerSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
n_row Number of rows in the table
Requiredinteger
#
Number of rows in the table
Type
integer
n_col Number of columns in the table
Requiredinteger
#
Number of columns in the table
Type
integer
rows List of table lines representing rows
Requiredarray
#
List of table lines representing rows
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
cols List of table lines representing columns
Requiredarray
#
List of table lines representing columns
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
spans List of table lines representing spans
Requiredarray
#
List of table lines representing spans
Type
array
Nested fields
TableLineSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the table line in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the table line in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the table line detection
Requirednumber
#
Confidence score of the table line detection
Type
number
cells List of table cells
Requiredarray
#
List of table cells
Type
array
Nested fields
TableCellSchema
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
col Column index of the cell
Requiredinteger
#
Column index of the cell
Type
integer
row Row index of the cell
Requiredinteger
#
Row index of the cell
Type
integer
col_span Number of columns spanned by the cell
Requiredinteger
#
Number of columns spanned by the cell
Type
integer
row_span Number of rows spanned by the cell
Requiredinteger
#
Number of rows spanned by the cell
Type
integer
box Bounding box of the cell in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the cell in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
contents Text content of the cell
RequiredanyOf
#
Text content of the cell
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#
order Order of the table in the document
Requiredinteger
#
Order of the table in the document
Type
integer
figures List of detected figures
Requiredarray
#
List of detected figures
Type
array
Nested fields
Element
No Additional Propsobject
#
Type
object
Constraints
  • Additional properties are not allowed
Nested fields
box Bounding box of the layout element in the format [x1, y1, x2, y2]
Requiredarray
#
Bounding box of the layout element in the format [x1, y1, x2, y2]
Type
array
Constraints
  • Minimum items: 4
  • Maximum items: 4
Nested fields
Item
integer
#
score Confidence score of the layout element detection
Requirednumber
#
Confidence score of the layout element detection
Type
number
role Role of the element, e.g., ['section_headings', 'page_header', 'page_footer', 'list_item', 'caption', 'inline_formula', 'display_formula', 'index']
RequiredanyOf
#
Role of the element, e.g., ['section_headings', 'page_header', 'page_footer', 'list_item', 'caption', 'inline_formula', 'display_formula', 'index']
Type
anyOf
Nested fields
Any of 1
string
#
Any of 2
null
#

Auto-generated from JSON Schema files.