build_token_df: Build token dataframe

Description Usage Arguments Details Value Examples

View source: R/process_output.R

Description

Builds a token dataframe from the text OCRed by Document AI (DAI) in an asynchronous request. Rows are tokens, in the order DAI proposes to read them. Columns are location variables such as page coordinates and block bounding box numbers.

Usage

1

Arguments

json

filepath of a JSON file obtained using dai_async()

Details

The location variables are: start index, end index, left boundary, right boundary, top boundary, bottom boundary, page number, and block number. Start and end indices refer to character position in the string containing the full text.

Value

a token data frame

Examples

1
2
3
4
## Not run: 
token_df <- build_token_df("pdf_output.json")

## End(Not run)

daiR documentation built on June 11, 2021, 5:16 p.m.