summaryrefslogtreecommitdiff
path: root/data/zh_cn/nlp-automl/2019-07-01/api-docs.php
blob: d2cd65ff5e09ca7353ca6150aedc05a99b38094b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?php return [
    'version' => '1.0',
    'info' => ['style' => 'RPC', 'product' => 'nlp-automl', 'version' => '2019-07-01'],
    'directories' => ['AddMTInterveneWord', 'GetPredictDoc', 'PredictMTModelByDoc'],
    'components' => [
        'schemas' => [],
    ],
    'apis' => [
        'AddMTInterveneWord' => [
            'methods' => ['post', 'get'],
            'schemes' => ['http', 'https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'APP' => [],
                ],
                [
                    'PrivateKey' => [],
                ],
            ],
            'operationType' => 'write',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'update'],
            'parameters' => [
                [
                    'name' => 'SourceText',
                    'in' => 'query',
                    'schema' => ['description' => '原文', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'hello'],
                ],
                [
                    'name' => 'TargetText',
                    'in' => 'query',
                    'schema' => ['description' => '译文', 'type' => 'string', 'required' => false, 'example' => '你好'],
                ],
                [
                    'name' => 'ProjectId',
                    'in' => 'query',
                    'schema' => ['description' => '项目id', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => '1'],
                ],
                [
                    'name' => 'PackageId',
                    'in' => 'query',
                    'schema' => ['description' => '词包id', 'type' => 'string', 'required' => false, 'docRequired' => true, 'example' => '1', 'default' => 'mt_automl'],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'Code' => ['description' => '接口返回码:200:表示成功。'."\n"
                                .'其它:表示错误码。错误码详情,请参见错误码。', 'type' => 'integer', 'format' => 'int32', 'example' => '200'],
                            'Message' => ['description' => '错误信息。错误码对应的错误信息。', 'type' => 'string', 'example' => 'parameterError'],
                            'RequestId' => ['description' => '请求id', 'type' => 'string', 'example' => '46E6B40D-2B6C-571B-AC41-86207DE288A5'],
                            'WordId' => ['description' => '新增成功的词id', 'type' => 'integer', 'format' => 'int64', 'example' => '1'],
                        ],
                        'description' => '',
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"Code\\": 200,\\n  \\"Message\\": \\"parameterError\\",\\n  \\"RequestId\\": \\"46E6B40D-2B6C-571B-AC41-86207DE288A5\\",\\n  \\"WordId\\": 1\\n}","type":"json"}]',
            'title' => '增加干预数据',
            'summary' => '把待干预的原文和译文添加到ProjectId和PackageId对应的dataSet上。',
            'description' => '请确保在使用该接口前,已充分了解NLP自学习平台产品的收费方式和[价格](https://common-buy.aliyun.com/?commodityCode=nlp_bag#/buy)',
            'changeSet' => [
                ['createdAt' => '2022-03-07T07:22:38.000Z', 'description' => '响应参数发生变更、错误码发生变更'],
            ],
            'flowControl' => [
                'flowControlList' => [
                    ['threshold' => '30', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddMTInterveneWord'],
                ],
                'product' => ['code' => 'nlp', 'title' => '自然语言处理'],
            ],
        ],
        'GetPredictDoc' => [
            'methods' => ['head', 'post', 'get'],
            'schemes' => ['http', 'https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'APP' => [],
                ],
                [
                    'PrivateKey' => [],
                ],
                [
                    'BearerToken' => [],
                ],
            ],
            'operationType' => 'readAndWrite',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'get'],
            'parameters' => [
                [
                    'name' => 'DocId',
                    'in' => 'query',
                    'schema' => ['description' => '文档id', 'type' => 'integer', 'format' => 'int64', 'required' => true, 'docRequired' => true, 'example' => '1000'],
                ],
                [
                    'name' => 'Product',
                    'in' => 'query',
                    'schema' => ['description' => '产品code', 'type' => 'string', 'required' => false, 'example' => '空', 'default' => 'mt_automl'],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'Status' => ['description' => '0:初始化 1:处理中 2:处理成功 3:处理失败', 'type' => 'integer', 'format' => 'int32', 'example' => '2'],
                            'RequestId' => ['description' => '请求id', 'type' => 'string', 'example' => '86D18195-D89C-4C8C-9DC4-5FCE789CE6D5'],
                            'ResultContent' => ['description' => '预测结果,文件流形式', 'type' => 'string', 'example' => 'xxx'],
                            'XLIFFInfo' => ['description' => 'xliff信息,文件流形式', 'type' => 'string', 'example' => 'xxx'],
                        ],
                        'description' => '',
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"Status\\": 2,\\n  \\"RequestId\\": \\"86D18195-D89C-4C8C-9DC4-5FCE789CE6D5\\",\\n  \\"ResultContent\\": \\"xxx\\",\\n  \\"XLIFFInfo\\": \\"xxx\\"\\n}","type":"json"}]',
            'title' => '获取文档预测结果',
            'summary' => '根据调用PredictMTModelByDoc返回的docId,调用该接口,返回预测后的结果。',
            'description' => '请确保在使用该接口前,已充分了解NLP自学习平台产品的收费方式和[价格](https://common-buy.aliyun.com/?commodityCode=nlp_bag#/buy)',
            'changeSet' => [],
        ],
        'PredictMTModelByDoc' => [
            'methods' => ['head', 'post', 'get'],
            'schemes' => ['http', 'https'],
            'security' => [
                [
                    'AK' => [],
                ],
                [
                    'APP' => [],
                ],
                [
                    'PrivateKey' => [],
                ],
                [
                    'BearerToken' => [],
                ],
            ],
            'operationType' => 'readAndWrite',
            'deprecated' => false,
            'systemTags' => ['operationType' => 'get'],
            'parameters' => [
                [
                    'name' => 'FileContent',
                    'in' => 'formData',
                    'schema' => ['description' => '文件数据内容,文件内容需进过base64编码', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => '[base64 encode content]'],
                ],
                [
                    'name' => 'FileType',
                    'in' => 'query',
                    'schema' => ['description' => '文件类型', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'docx'],
                ],
                [
                    'name' => 'ModelId',
                    'in' => 'query',
                    'schema' => ['description' => '模型id', 'type' => 'integer', 'format' => 'int32', 'required' => true, 'docRequired' => true, 'example' => '1'],
                ],
                [
                    'name' => 'NeedXLIFF',
                    'in' => 'query',
                    'schema' => ['description' => '是否需要xliff信息', 'type' => 'boolean', 'required' => false, 'example' => 'true'],
                ],
                [
                    'name' => 'ModelVersion',
                    'in' => 'query',
                    'schema' => ['description' => '模型版本', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'v1'],
                ],
            ],
            'responses' => [
                200 => [
                    'schema' => [
                        'type' => 'object',
                        'properties' => [
                            'DocId' => ['description' => '文档id', 'type' => 'string', 'example' => '1'],
                            'RequestId' => ['description' => '请求id', 'type' => 'string', 'example' => '86D18195-D89C-4C8C-9DC4-5FCE789CE6D5'],
                        ],
                        'description' => '',
                    ],
                ],
            ],
            'responseDemo' => '[{"errorExample":"","example":"{\\n  \\"DocId\\": \\"1\\",\\n  \\"RequestId\\": \\"86D18195-D89C-4C8C-9DC4-5FCE789CE6D5\\"\\n}","type":"json"}]',
            'title' => '提交文档预测任务',
            'summary' => '上传文档内容,指定模型进行预测。',
            'description' => '请确保在使用该接口前,已充分了解NLP自学习平台产品的收费方式和[价格](https://common-buy.aliyun.com/?commodityCode=nlp_bag#/buy)',
            'changeSet' => [
                ['createdAt' => '2024-07-04T02:12:17.000Z', 'description' => '错误码发生变更'],
            ],
            'flowControl' => [
                'flowControlList' => [
                    ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'PredictMTModelByDoc'],
                ],
                'product' => ['code' => 'nlp', 'title' => '自然语言处理'],
            ],
        ],
    ],
    'endpoints' => [
        ['regionId' => 'cn-hangzhou', 'regionName' => '华东1(杭州)', 'areaId' => 'asiaPacific', 'areaName' => '亚太', 'public' => 'nlp-automl.cn-hangzhou.aliyuncs.com', 'endpoint' => 'nlp-automl.cn-hangzhou.aliyuncs.com', 'vpc' => 'nlp-automl-vpc.cn-hangzhou.aliyuncs.com'],
    ],
    'errorCodes' => [
        ['code' => '40001', 'message' => 'The quota for calling the model is exceeded.', 'http_code' => 403, 'description' => '调用额度已超出限制'],
        ['code' => '40002', 'message' => 'The specified interface is throttled.', 'http_code' => 403, 'description' => '调用接口被限流'],
        ['code' => '40003', 'message' => 'An error occurred while authenticating the model.', 'http_code' => 403, 'description' => '模型鉴权失败'],
        ['code' => '40004', 'message' => 'A server error occurred while processing your request. Please try again later or contact customer support.', 'http_code' => 200, 'description' => '服务器内部出现错误,请稍后重试或者联系客服人员帮忙解决。'],
        ['code' => '40013', 'message' => 'An error occurred while authenticating the model.', 'http_code' => 403, 'description' => '模型鉴权失败'],
        ['code' => 'Account arrearage', 'message' => 'The account is arrearage.', 'http_code' => 400, 'description' => '账户已欠费'],
        ['code' => 'BaseModelNotFound', 'message' => 'The base model is not found.', 'http_code' => 400, 'description' => '未找到基础模型'],
        ['code' => 'createModelConcurrency', 'message' => 'Creating multiple models at the same time is not allowed.', 'http_code' => 400, 'description' => '不允许同时创建多个模型。'],
        ['code' => 'DataCenter.IllegalDatasetId', 'message' => 'The format of the dataset ID is invalid.', 'http_code' => 403, 'description' => '数据集ID不是有效的数据集ID'],
        ['code' => 'DataCenter.IllegalDatasetRecord', 'message' => 'The format of the dataset record is invalid.', 'http_code' => 403, 'description' => '数据集标注数据格式无效'],
        ['code' => 'dataFormatError', 'message' => 'The number of data bars added exceeds 500.', 'http_code' => 400, 'description' => '添加的数据条数过大,超过了500条'],
        ['code' => 'DocParseError', 'message' => 'The version of the uploaded DOC file is too early to support parsing. You are advised to replace the DOCX file with the latest version.', 'http_code' => 400, 'description' => '上传的DOC文件类型的版本过低,不支持解析,建议替换为最新版本的DOCX。'],
        ['code' => 'FileParseError', 'message' => 'The uploaded file failed to be parsed.', 'http_code' => 500, 'description' => '上传的文件解析失败。'],
        ['code' => 'Forbbiden', 'message' => 'You are not authorized to operate on the specified resource.', 'http_code' => 403, 'description' => '用户未被授权操作指定的资源。'],
        ['code' => 'InternalError', 'message' => 'An error occurred while processing your request.', 'http_code' => 500, 'description' => '未知错误。'],
        ['code' => 'InvalidAccountStatus.ServiceLimit', 'message' => 'The maximum number of free API daily visits is exceeded.', 'http_code' => 400, 'description' => 'API访问次数超过了免费额度限制。'],
        ['code' => 'InvalidAccountStatus.ServiceUnavailable', 'message' => 'The NLP Auto Machine Learning service has not been activated.', 'http_code' => 400, 'description' => '用户未开通NLP自学习服务。'],
        ['code' => 'InvalidContentLength', 'message' => 'The length of content exceeds the limit.', 'http_code' => 400, 'description' => '内容长度过长。'],
        ['code' => 'InvalidParameter', 'message' => 'The parameter is invalid.', 'http_code' => 400, 'description' => '参数错误'],
        ['code' => 'InvalidParameter.ModelId', 'message' => 'The specified modelId is invalid.', 'http_code' => 400, 'description' => '参数modelId不合法。'],
        ['code' => 'InvalidParameter.ModelVersion', 'message' => 'The specified modelVersion is invalid.', 'http_code' => 400, 'description' => '参数modelVersion不合法。'],
        ['code' => 'InvalidServiceName', 'message' => 'The service does not exist.', 'http_code' => 400, 'description' => '服务不存在。'],
        ['code' => 'ModelCenter.CreateModelLimit', 'message' => 'The maximum number of models you created is exceeded.', 'http_code' => 403, 'description' => '创建模型数量已达上限'],
        ['code' => 'ModelCenter.DeployModelLimit', 'message' => 'The maximum number of online models is exceeded. You cannot deploy the model.', 'http_code' => 403, 'description' => '模型在线数量已达上限,不能发布'],
        ['code' => 'ModelCenter.IllegalModelName', 'message' => 'The format of the model name is invalid.', 'http_code' => 400, 'description' => '模型名称格式错误'],
        ['code' => 'ModelCenter.MinTrainingcount', 'message' => 'The number of model training records is less than 4.', 'http_code' => 400, 'description' => '模型训练数据少于4条'],
        ['code' => 'ModelCenter.ModelNotFound', 'message' => 'The model information is not found.', 'http_code' => 400, 'description' => '未找到模型信息'],
        ['code' => 'ModelCenter.ModelNotInProject', 'message' => 'The model is not in the specified project.', 'http_code' => 400, 'description' => '项目ID不匹配'],
        ['code' => 'ModelCenter.ModelStatusError', 'message' => 'The model status is abnormal.', 'http_code' => 400, 'description' => '模型状态异常'],
        ['code' => 'ModelCenter.NoDatasetOnline', 'message' => 'The status of the training dataset is not online.', 'http_code' => 400, 'description' => '数据集状态未在线'],
        ['code' => 'ModelCenter.NoPermission', 'message' => 'You are not authorized to perform the operation.', 'http_code' => 403, 'description' => '无权限操作'],
        ['code' => 'ModelCenter.NotFoundConfig', 'message' => 'The configuration information of the model type is not found.', 'http_code' => 400, 'description' => '未找到模型类型配置信息'],
        ['code' => 'ModelCenter.OnlineModelLimit', 'message' => 'The maximum number of online models is exceeded.', 'http_code' => 403, 'description' => '模型在线数量已达上限,不能操作上线'],
        ['code' => 'ModelGroupNotFound', 'message' => 'The model group is not found.', 'http_code' => 400, 'description' => '未找到模型组信息'],
        ['code' => 'ModelInferenceError', 'message' => 'Failed to obtain the model prediction result.', 'http_code' => 500, 'description' => '获取模型预测结果失败。'],
        ['code' => 'ModelInferenceFailed', 'message' => 'The model inference result is null.', 'http_code' => 500, 'description' => '模型推测结果为空'],
        ['code' => 'NotFoundUploadDataError', 'message' => 'No data set is created.', 'http_code' => 400, 'description' => '未创建数据集。'],
        ['code' => 'parameterError', 'message' => 'The parameter is invalid.', 'http_code' => 400, 'description' => '参数错误'],
        ['code' => 'PermissionDeny', 'message' => 'No RAM permission.', 'http_code' => 400, 'description' => '改账号没有权限'],
        ['code' => 'postPaidArrearage', 'message' => 'The service is not opened or the account is overdue.', 'http_code' => 400, 'description' => '服务未开通或账户已欠费。'],
        ['code' => 'postpaidArrearageError', 'message' => 'You have an overdue payment.', 'http_code' => 400, 'description' => '您已欠费'],
        ['code' => 'predictContentLength', 'message' => 'The length of content exceeds the limit.', 'http_code' => 400, 'description' => '输入预测内容的长度超出限制。'],
        ['code' => 'predictLimit', 'message' => 'The maximum number of submitted tasks is exceeded.', 'http_code' => 400, 'description' => '提交任务到达上限'],
        ['code' => 'predictQpsLimit', 'message' => 'The maximum number of queries-per-second is exceeded.', 'http_code' => 403, 'description' => '单模型QPS达到上限'],
        ['code' => 'predictTimeout', 'message' => 'model predict cost greater than 9000ms.', 'http_code' => 500, 'description' => '模型响应时间超过9秒。'],
        ['code' => 'queryExceedMaxDuration', 'message' => 'The query data exceeds the upper limit.', 'http_code' => 400, 'description' => '查询数据超过允许的最大区间。'],
        ['code' => 'ResourceNotFound', 'message' => 'The specified Model does not exist.', 'http_code' => 404, 'description' => '指定的模型不存在。'],
        ['code' => 'ServiceUnavailable', 'message' => 'An error occurred while processing your request.', 'http_code' => 503, 'description' => '服务内部错误。'],
        ['code' => 'UnknownError', 'message' => 'A server error occurred while processing your request. Please try again later or contact customer support.', 'http_code' => 500, 'description' => '未知错误。'],
    ],
    'changeSet' => [
        [
            'apis' => [
                ['description' => '错误码发生变更', 'api' => 'GetPredictDoc'],
                ['description' => '错误码发生变更', 'api' => 'PredictMTModelByDoc'],
            ],
            'createdAt' => '2024-07-04T02:12:21.000Z',
            'description' => '',
        ],
        [
            'apis' => [
                ['description' => '响应参数发生变更、错误码发生变更', 'api' => 'AddMTInterveneWord'],
            ],
            'createdAt' => '2022-03-07T07:23:44.000Z',
            'description' => '修改AddMTInterveneWord这个接口的返回的message和wordId的数据类型,其他接口从public修改为private',
        ],
    ],
    'flowControl' => [
        'flowControlList' => [
            ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'GetPredictDoc'],
            ['threshold' => '5', 'countWindow' => 1, 'regionId' => '*', 'api' => 'PredictMTModelByDoc'],
            ['threshold' => '30', 'countWindow' => 1, 'regionId' => '*', 'api' => 'AddMTInterveneWord'],
        ],
        'product' => ['code' => 'nlp', 'title' => '自然语言处理'],
    ],
];