[英]How to Process JSON response of Google Document AI OCR Api to proper structure?
I want to make proper structured txt file out of scanned pdf file in Google document ai ocr response, but I get a json response from the document.我想从 Google 文档 ai ocr 响应中扫描的 pdf 文件中制作出正确的结构化 txt 文件,但我从文档中得到了 json 响应。 An ocr response which contains all text of file in one string and X,Y coordinates of pdf file image along with indexes of blocks or tokens for that string.
一个 OCR 响应,其中包含一个字符串中的所有文件文本和 pdf 文件图像的 X、Y 坐标以及该字符串的块或标记的索引。 I am not able to map that text on received coordinates to make a txt file or some other format file.
我无法 map 收到坐标上的文本来制作 txt 文件或其他格式的文件。
How can I save this as a txt file?我怎样才能将这个保存为txt文件?
This page in the documentation shows how to handle the processing response, including extracting the raw text from the document, which can be loaded into a TXT file.文档中的此页面显示了如何处理处理响应,包括从文档中提取原始文本,可以将其加载到 TXT 文件中。 It also explains the structure of the Document.json output.
它还解释了 Document.json output 的结构。
https://cloud.google.com/document-ai/docs/handle-response#basic_text https://cloud.google.com/document-ai/docs/handle-response#basic_text
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.