简体   繁体   English

如何处理 Google Document AI OCR Api 的 JSON 响应到正确的结构?

[英]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.

相关问题 带有 Salesforce 的 Google Document AI(发票 OCR) - Google Document AI(invoice OCR) with Salesforce 使用 Google Document AI(表单解析器 API)进行身份验证 - Authentication with Google Document AI (Form Parser API) Google Document AI api 认证错误 - Google Document AI api authentication error 谷歌文档 AI 标签任务 - Google Document AI Labeling Task Google Document AI - 参数无效 - Google Document AI - Invalid argument 由于“智能文档质量处理器”现在不可用,如何在 google document AI 中获取文档质量分数? - How to get the document quality score in google document AI as the "Intelligent document quality processor" is not available now? Google Document AI - 不一致的长期运行操作的元数据 JSON 表示 - Google Document AI - Inconsistent Long Running Operation's metadata JSON representation 无法在 PHP 中获取表单字段的 Google Cloud Document AI 处理响应 - Google Cloud Document AI processing response impossible to get Form Fields in PHP 尝试使用 Google Cloud 文档 AI API 请求 Python 中的 field_mask 获取特定字段 - Trying to get specific fields using field_mask in Google Cloud document AI API request Python Document AI - 改进单个文档的批处理时间? - Document AI - Improving batch process time for a single document?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM