text_from_dai_file: Get text from output file

View source: R/inspect_output.R

text_from_dai_fileR Documentation

Get text from output file

Description

Extracts the text OCRed by Document AI (DAI) in an asynchronous processing request.

Usage

text_from_dai_file(file, save_to_file = FALSE, dest_dir = getwd())

Arguments

file

filepath of a JSON file obtained using dai_async()

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

Value

a string (if save_to_file = FALSE)

Examples

## Not run: 
text <- text_from_dai_file("mydoc-0.json")
text_from_dai_file("mydoc-0.json", save_to_file = TRUE)

## End(Not run)

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