View source: R/process_output.R
build_token_df | R Documentation |
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.
build_token_df(type, output)
type |
one of "sync" or "async" depending on the function used to process the original document. |
output |
either a HTTP response object (from |
The location variables are: token, start index, end index, confidence, 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.
a token data frame
## Not run:
token_df <- build_token_df(type = "async", output = "pdf_output.json")
resp <- dai_sync("file.pdf")
token_df <- build_token_df(type = "sync", output = resp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.