text_from_dai_response: Get text from HTTP response object

View source: R/inspect_output.R

text_from_dai_responseR Documentation

Get text from HTTP response object

Description

Extracts the text OCRed by Document AI (DAI) in a synchronous processing request.

Usage

text_from_dai_response(
  response,
  save_to_file = FALSE,
  dest_dir = getwd(),
  filename = "output"
)

Arguments

response

an HTTP response object returned by dai_sync()

save_to_file

boolean; whether to save the text as a .txt file

dest_dir

folder path for the .txt output file if save_to_file = TRUE

filename

string to form the stem of the .txt output file

Value

a string (if save_to_file = FALSE)

Examples

## Not run: 
text <- text_from_dai_response(response)

text_from_dai_response(response, save_to_file = TRUE)

## End(Not run)

daiR documentation built on Sept. 8, 2023, 5:43 p.m.