你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Read - Read
使用此接口获取读取操作的结果,该操作采用最先进的光学字符识别 (OCR) 算法,这些算法针对大量文本的文档进行优化。 使用 Read 接口时,响应包含一个名为“Operation-Location”的字段。 “Operation-Location”字段包含“GetReadResult”操作访问 OCR 结果时必须使用的 URL。
POST {Endpoint}/vision/v3.1/read/analyze
POST {Endpoint}/vision/v3.1/read/analyze?language={language}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
Endpoint
|
path | True |
string |
支持的认知服务终结点。 |
language
|
query |
文档中文本的 BCP-47 语言代码。 目前,仅支持英语 ('en') 、荷兰语 ('nl') 、法语 ('fr') 、德语 ('de') 、意大利语 ('it'it') 、葡萄牙语 ('pt) 和西班牙语 ('es') 。 Read 支持自动语言识别和多语言文档,因此仅当你想要强制将文档作为该特定语言进行处理时,才提供语言代码。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
url | True |
string |
图像的可公开访问 URL。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
该服务已接受请求,稍后将开始处理。 Headers Operation-Location: string |
|
Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
示例
Successful Analyze request
Sample Request
POST {Endpoint}/vision/v3.1/read/analyze?language=en
{
"url": "{url}"
}
Sample Response
定义
名称 | 说明 |
---|---|
Computer |
有关 API 请求错误的详细信息。 |
Computer |
错误代码。 |
Image |
|
Ocr |
文档中文本的 BCP-47 语言代码。 目前,仅支持英语 ('en') 、荷兰语 ('nl') 、法语 ('fr') 、德语 ('de') 、意大利语 ('it'it') 、葡萄牙语 ('pt) 和西班牙语 ('es') 。 Read 支持自动语言识别和多语言文档,因此仅当你想要强制将文档作为该特定语言进行处理时,才提供语言代码。 |
ComputerVisionError
有关 API 请求错误的详细信息。
名称 | 类型 | 说明 |
---|---|---|
code |
错误代码。 |
|
message |
string |
解释服务报告的错误的消息。 |
requestId |
string |
唯一的请求标识符。 |
ComputerVisionErrorCodes
错误代码。
名称 | 类型 | 说明 |
---|---|---|
BadArgument |
string |
|
CancelledRequest |
string |
|
DetectFaceError |
string |
|
FailedToProcess |
string |
|
InternalServerError |
string |
|
InvalidDetails |
string |
|
InvalidImageFormat |
string |
|
InvalidImageSize |
string |
|
InvalidImageUrl |
string |
|
InvalidModel |
string |
|
InvalidThumbnailSize |
string |
|
NotSupportedFeature |
string |
|
NotSupportedImage |
string |
|
NotSupportedLanguage |
string |
|
NotSupportedVisualFeature |
string |
|
StorageException |
string |
|
Timeout |
string |
|
Unspecified |
string |
|
UnsupportedMediaType |
string |
ImageUrl
名称 | 类型 | 说明 |
---|---|---|
url |
string |
图像的可公开访问 URL。 |
OcrDetectionLanguage
文档中文本的 BCP-47 语言代码。 目前,仅支持英语 ('en') 、荷兰语 ('nl') 、法语 ('fr') 、德语 ('de') 、意大利语 ('it'it') 、葡萄牙语 ('pt) 和西班牙语 ('es') 。 Read 支持自动语言识别和多语言文档,因此仅当你想要强制将文档作为该特定语言进行处理时,才提供语言代码。
名称 | 类型 | 说明 |
---|---|---|
de |
string |
|
en |
string |
|
es |
string |
|
fr |
string |
|
it |
string |
|
nl |
string |
|
pt |
string |