1. 接口描述
接口请求域名: ecc.tencentcloudapi.com 。
https://ecc.tencentcloudapi.com/?Action=CorrectMultiImage
多图像识别批改接口
默认接口请求频率限制:10次/秒。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CorrectMultiImage。 |
Version | 是 | String | 公共参数,本接口取值:2018-12-13。 |
Region | 否 | String | 公共参数,本接口不需要传递此参数。 |
Image.N | 是 | Array of String | 图片的url链接或base64数据。每张图片数据作为数组的一个元素,数组个数与图片个数保持一致。存放类别依据InputType而定,url与base64编码不能混合使用。 |
InputType | 是 | Integer | 输出图片类型,0 表示 Image 字段是图片所在的 url,1 表示 Image 字段是 base64 编码后的图像数据。 示例值:0 |
EccAppid | 否 | String | 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数。 示例值:default |
SessionId | 否 | String | 图像识别唯一标识,一次识别一个 SessionId,使用识别功能时 SessionId 可用于使用文本批改接口,此时按图像批改价格收费;如使用文本批改接口时没有传入 SessionId,则需要收取文本批改的费用。 |
ServerType | 否 | Integer | 服务类型,0:“多图像识别”,只返回识别结果;1:“多图像批改”,同时返回识别结果与批改结果。默认为 0。 示例值:1 |
Title | 否 | String | 作文题目,可选参数 |
Grade | 否 | String | 年级标准, 默认以 cet4 为标准,取值与意义如下:elementary 小学,grade7 grade8 grade9分别对应初一,初二,初三。 grade10 grade11 grade12 分别对应高一,高二,高三,以及 cet4 和 cet6 分别表示 英语4级和6级。 示例值:elementary |
Requirement | 否 | String | 作文提纲,可选参数,作文的写作要求。 |
ModelTitle | 否 | String | 范文标题,可选参数,本接口可以依据提供的范文对作文进行评分。 |
ModelContent | 否 | String | 范文内容,可选参数,同上,范文的正文部分。 |
IsAsync | 否 | Integer | 异步模式标识,0:同步模式,1:异步模式。默认为同步模式 示例值:0 |
3. 输出参数
参数名称 | 类型 | 描述 |
---|---|---|
ResultData | CompositionContext | 接口返回数据 |
RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 多图像识别批改-批改
ServerType = 1,使用批改功能,只返回批改结果。
注意:图像批改耗时较长,超过4s后返回异步任务结果。
输入示例
https://ecc.tencentcloudapi.com/?Action=CorrectMultiImage
&InputType=0
&Image.0=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/0999.jpg
&Image.1=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/1000.jpg
&ServerType=1
&<公共请求参数>
输出示例
{
"Response": {
"ResultData": {
"Content": "",
"CorrectData": {
"Score": 63.59,
"ScoreCat": {
"Words": {
"Name": "词汇",
"Score": 66.15,
"Percentage": 42
},
"Sentences": {
"Name": "句子",
"Score": 63.9,
"Percentage": 28
},
"Structure": {
"Name": "篇章结构",
"Score": 57.82,
"Percentage": 23
},
"Content": {
"Name": "内容",
"Score": 65.96,
"Percentage": 7
},
"Score": 0,
"Percentage": 0
},
"Comment": "可适当注意词汇积累,多使用一些高级词语;可适当增加复合句和从句的使用;文章衔接不够流畅思路主题尚可,有待提高。请多加练习,更上一层楼。",
"SentenceComments": [
{
"Sentence": {
"Sentence": "First, the environment in Nanjing is beautiful and there are many trees on both sides an of the road Next ,it's very easy to travel around the city and there are many ways.",
"ParaID": 2,
"SentenceID": 0
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "连词建议",
"Origin": "an",
"Replace": "and",
"Message": "连接词使用可能不当,请结合上下文确认此处正确的连词,推荐将 an 替换为 and",
"ErrorPosition": [
15,
15
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "标点错误",
"Origin": "",
"Replace": ".",
"Message": "标点符号缺失,请检查断句是否合理,需要插入 .",
"ErrorPosition": [
18,
19
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "People all have a confortable life,here are lots of tall buildings for or them to live.",
"ParaID": 2,
"SentenceID": 1
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "拼写错误",
"Origin": "confortable",
"Replace": "comfortable",
"Message": "confortable 可能是拼写错误,请注意拼写检查,这里应将 confortable 替换为 comfortable",
"ErrorPosition": [
4,
4
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "标点建议",
"Origin": ",",
"Replace": ".",
"Message": "标点符号可能使用不当,请检查断句情况,推荐将 , 替换为 .",
"ErrorPosition": [
5,
5
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "词形错误",
"Origin": "here",
"Replace": "Here",
"Message": "大小写拼写错误,这里应将 here 替换为 Here",
"ErrorPosition": [
6,
6
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "介词错误",
"Origin": "",
"Replace": "for",
"Message": "介词缺失,需要插入 for",
"ErrorPosition": [
13,
14
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "What's more, Nanjing has many interesting places and lots of visiters come here every year.",
"ParaID": 3,
"SentenceID": 0
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "拼写错误",
"Origin": "visiters",
"Replace": "visitors",
"Message": "visiters 可能是拼写错误,请注意拼写检查,这里应将 visiters 替换为 visitors",
"ErrorPosition": [
10,
10
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "All in all, Nanjing is a good place to visit Yours sincerely, and I hope you can visit it some day Su Hua Dear Peter,",
"ParaID": 4,
"SentenceID": 0
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "词形错误",
"Origin": "Yours",
"Replace": "yours",
"Message": "大小写拼写错误,这里应将 Yours 替换为 yours",
"ErrorPosition": [
10,
10
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "There a are many trees and mountains.",
"ParaID": 6,
"SentenceID": 1
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "限定词错误",
"Origin": "a",
"Replace": "",
"Message": "冠词使用多余,请确认是否需要使用不定冠词,应当删除 ",
"ErrorPosition": [
1,
1
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "And the transport changes.",
"ParaID": 6,
"SentenceID": 4
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "限定词建议",
"Origin": "the transport",
"Replace": "transportation",
"Message": "可能存在限定词使用错误,请结合上下文分析此处正确的限定词,推荐将 the transport 替换为 transportation",
"ErrorPosition": [
1,
2
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "When people want to go out and taxi they can take a or an underground Furthermore, Naying is a good place to travel.",
"ParaID": 6,
"SentenceID": 5
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "词形错误",
"Origin": "Furthermore",
"Replace": "furthermore",
"Message": "大小写拼写错误,这里应将 Furthermore 替换为 furthermore",
"ErrorPosition": [
15,
15
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "语法建议",
"Origin": "Naying",
"Replace": "saying it",
"Message": "可能存在语法错误,推荐将 Naying 替换为 saying it",
"ErrorPosition": [
16,
16
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "There are many places of interest.",
"ParaID": 6,
"SentenceID": 6
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "语法建议",
"Origin": "",
"Replace": "interesting",
"Message": "成分可能缺失,推荐插入 interesting",
"ErrorPosition": [
2,
3
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "连词错误",
"Origin": "of interest",
"Replace": "",
"Message": "连词使用多余,请确认此处是否需要使用连词,应当删除 ",
"ErrorPosition": [
4,
5
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "You can a visit Xuanoun Park.",
"ParaID": 6,
"SentenceID": 7
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "限定词错误",
"Origin": "a",
"Replace": "",
"Message": "冠词使用多余,请确认是否需要使用不定冠词,应当删除 ",
"ErrorPosition": [
2,
2
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
},
{
"Type": "Error",
"ErrorType": "拼写错误",
"Origin": "Xuanoun",
"Replace": "unsound",
"Message": "xuanoun 可能是拼写错误,请注意拼写检查,这里应将 Xuanoun 替换为 unsound",
"ErrorPosition": [
4,
4
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "You can see many views in it.",
"ParaID": 6,
"SentenceID": 8
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "介词建议",
"Origin": "in",
"Replace": "from",
"Message": "介词使用可能存在不当,请结合语境分析此处正确的介词,推荐将 in 替换为 from",
"ErrorPosition": [
5,
5
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "All in all, I think Nanjing is a peaceful and Yours sincerely, perfect city.",
"ParaID": 6,
"SentenceID": 9
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "词形错误",
"Origin": "Yours",
"Replace": "yours",
"Message": "大小写拼写错误,这里应将 Yours 替换为 yours",
"ErrorPosition": [
10,
10
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
},
{
"Sentence": {
"Sentence": "I hope it can be better and better.",
"ParaID": 6,
"SentenceID": 10
},
"Suggestions": [
{
"Type": "Error",
"ErrorType": "时态建议",
"Origin": "can be",
"Replace": "will get",
"Message": "可能存在将来时使用错误,请确认时态及将来时的表达方式,推荐将 can be 替换为 will get",
"ErrorPosition": [
3,
4
],
"ErrorCoordinates": [
{
"Coordinate": [
0
]
}
]
}
]
}
]
}
},
"RequestId": "6560fa28-683e-454f-b8a2-88bee017836a"
}
}
示例2 多图像识别批改-识别
ServerType = 0,使用识别功能,只返回识别文本。
输入示例
https://ecc.tencentcloudapi.com/?Action=CorrectMultiImage
&InputType=0
&Image.0=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/0999.jpg
&Image.1=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/1000.jpg
&ServerType=0
&<公共请求参数>
输出示例
{
"Response": {
"Data": {
"Content": " Dear Peter,\n I am glad to hear from you. Let me tell you something about Nanjing.\nFirst, the environment in Nanjing is beautiful and there are many trees on both sides an of the road\nNext ,it's very easy to travel around the city and there are many ways. People all have a confortable life,here are lots of tall buildings for or them to live.\nWhat's more, Nanjing has many interesting places and lots of visiters come here every year.\nAll in all, Nanjing is a good place to visit Yours sincerely, and I hope you can visit it some day Su Hua\n Dear Peter,\n I am glad to hear from you. Let me tell you something about Nanjing.\nNanjing is a clean and beautiful city. There a are many trees and mountains. Also, people here live a happy life. They live in comfortable flaks and communicate with their friends easily. And the transport changes. When people want to go out and\ntaxi they can take a or an underground Furthermore, Naying is a good place to travel. There are many places of interest. You can a visit Xuanoun Park. You can see many views in it. All in all, I think Nanjing is a peaceful and Yours sincerely, perfect city. I hope it can be better\nand better. Su Hua\n",
"CorrectData": null,
"TaskId": "",
"SessionId": ""
},
"RequestId": "4cd778bd-4e62-44a3-bd6a-27686c2af81d"
}
}
示例3 多图像识别批改-异步批改
ServerType = 1,使用批改功能,只返回批改结果。
IsAsync= 1,使用异步处理。
输入示例
https://ecc.tencentcloudapi.com/?Action=CorrectMultiImage
&InputType=0
&Image.0=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/0999.jpg
&Image.1=https://ecc-access-file-test-1253364609.cos.ap-guangzhou.myqcloud.com/1000.jpg
&ServerType=1
&IsAsync=1
&<公共请求参数>
输出示例
{
"Response": {
"Data": {
"Content": "",
"CorrectData": null,
"TaskId": "10001265",
"SessionId": ""
},
"RequestId": "1d417477-05cb-409e-b4bf-b4a4842ef513"
}
}
5. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python: GitHub Gitee
- Tencent Cloud SDK 3.0 for Java: GitHub Gitee
- Tencent Cloud SDK 3.0 for PHP: GitHub Gitee
- Tencent Cloud SDK 3.0 for Go: GitHub Gitee
- Tencent Cloud SDK 3.0 for Node.js: GitHub Gitee
- Tencent Cloud SDK 3.0 for .NET: GitHub Gitee
- Tencent Cloud SDK 3.0 for C++: GitHub Gitee
- Tencent Cloud SDK 3.0 for Ruby: GitHub Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
InternalError | 内部错误。 |
InternalError.CorrectError | 批改错误。 |
InternalError.DatabaseServerInternalError | 服务内部错误。 |
InternalError.OcrError | 识别错误。 |
InternalError.OcrServerInternError | 服务器内部错误,初始化失败。 |
InternalError.OtherError | 其它错误。 |
InternalError.OverLoadError | 服务器过载,请联系相关客服。 |
InternalError.RecognizeError | 图片识别错误。 |
InternalError.ServerConnectDownloadError | 无法连接图像下载服务器。 |
InternalError.SplitError | 图片切割错误。 |
InvalidParameter.EmptyParameterError | 参数为空。 |
InvalidParameter.InputError | 传入的参数有误。 |
InvalidParameterValue.AppidInvalidError | Appid无效。 |
InvalidParameterValue.DecodeImageError | 图片解码失败,请核实输入信息。 |
InvalidParameterValue.DownloadImageFailError | url图片下载失败。 |
InvalidParameterValue.EmptyImageError | 图片数据为空。 |
InvalidParameterValue.ImageDownloadFailError | 图片下载失败。 |
InvalidParameterValue.ImageSizeExceedError | 图片超出下载限制。 |
InvalidParameterValue.ImageTooBigError | 图片尺寸太大。 |
InvalidParameterValue.InputTypeValueError | 输入错误,请核实InputType参数。 |
InvalidParameterValue.SessionError | SessionId无效。 |
InvalidParameterValue.UrlFromatIvadlidError | 图像请求URL的格式错误。 |
LimitExceeded.FreqLimitForbiddenAccessError | 频率限制。 |
ResourceNotFound.CannotFindUser | 无法找到用户,请确认已在控制台开通服务并使用了正确的 ECCAPPID。 |
ResourceNotFound.ServerNameNotExistInLicenseError | 无效的服务名称。 |
ResourceUnavailable.AuthorizeError | 服务未开通或已欠费。 |
UnauthorizedOperation.LicenseInvalidForbiddenAccessError | license无效。 |
UnauthorizedOperation.ServerNameUnauthorizedInError | license中未授权该服务。 |