注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > API类目 > 阿里翻译API

alibaba.intl.translationplatform.textsmooth.get (查询文本顺滑结果)

查询文本顺滑结果

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
text_smooth_param_dto TextSmoothParamDTO 可选 顺滑参数对象
  • └ source_lang
  • String
  • 可选
  • zh
  • 源语种
  • └ app_name
  • String
  • 可选
  • cloud_alimtct_it_ecommerce
  • 应用名称
  • └ context_id
  • String
  • 可选
  • 3e1c6b0d48c3446ea5658078c4438db6
  • 上下文ID
  • ocr_result_dto
  • OcrResultDTO
  • 可选
  • OCR结果对象
  • └ org_width
  • Number
  • 可选
  • 882
  • 图片原始宽度
  • └ width
  • Number
  • 可选
  • 882
  • 图片旋转后宽度
  • └ word_num
  • Number
  • 可选
  • 2
  • 字块数量
  • └ angle
  • Number
  • 可选
  • 0
  • 图片旋转角度
  • table_info_dto_list
  • OcrTableInfoDTO []
  • 可选
  • OcrTableInfoDTO
  • 表格信息列表
  • cell_infos
  • OcrTableCellInfoDTO []
  • 可选
  • OcrTableCellInfoDTO
  • 单元格信息
  • pos
  • Coord []
  • 可选
  • Coord
  • 坐标信息
  • └ x
  • Number
  • 可选
  • 1
  • 横坐标
  • └ y
  • Number
  • 可选
  • 1
  • 纵坐标
  • └ yec
  • Number
  • 可选
  • 2
  • 表示纵向,结束是第几个表格
  • └ xec
  • Number
  • 可选
  • 2
  • 表示横向,结束是第几个表格
  • └ ysc
  • Number
  • 可选
  • 1
  • 表示纵向,开始是第几个表格
  • └ table_cell_id
  • Number
  • 可选
  • 1
  • 单元格ID
  • └ xsc
  • Number
  • 可选
  • 1
  • 表示横向,开始是第几个表格
  • └ word
  • String
  • 可选
  • Hello
  • 文字内容
  • └ x_cell_size
  • Number
  • 可选
  • 0
  • 横向单元格长度
  • └ table_id
  • Number
  • 可选
  • 0
  • 表格ID
  • └ y_cell_size
  • Number
  • 可选
  • 0
  • 纵向单元格长度
  • └ org_height
  • Number
  • 可选
  • 800
  • 原始图片高度
  • └ trg_lang
  • String
  • 可选
  • en
  • 目标语种
  • ocr_coord_dto_list
  • OcrCoordDTO []
  • 可选
  • OcrCoordDTO
  • OCR坐标对象列表
  • down_left
  • Coord
  • 可选
  • 字块左下角坐标
  • └ x
  • Number
  • 可选
  • 14
  • 左下角横坐标
  • └ y
  • Number
  • 可选
  • 657
  • 左下角纵坐标
  • └ confidence
  • String
  • 可选
  • 0.99
  • 置信度,范围0~1
  • up_right
  • Coord
  • 可选
  • 字块右上角坐标
  • └ x
  • Number
  • 可选
  • 595
  • 右上角横坐标
  • └ y
  • Number
  • 可选
  • 604
  • 右上角纵坐标
  • up_left
  • Coord
  • 可选
  • 左上角坐标
  • └ x
  • Number
  • 可选
  • 14
  • 左上角横坐标
  • └ y
  • Number
  • 可选
  • 604
  • 左上角纵坐标
  • down_right
  • Coord
  • 可选
  • 右下角坐标
  • └ x
  • Number
  • 可选
  • 595
  • 右下角横坐标
  • └ y
  • Number
  • 可选
  • 657
  • 右下角纵坐标
  • └ table_id
  • Number
  • 可选
  • 0
  • 表格ID
  • └ table_cell_id
  • Number
  • 可选
  • 0
  • 单元格ID
  • └ text
  • String
  • 可选
  • 一件包邮送头饰团扇眉心贴
  • 识别文本
  • └ direction
  • Number
  • 可选
  • 0
  • 文字方向:0.横行,1.竖行
  • └ in_entity
  • Boolean
  • 可选
  • false
  • 是否在实体内
  • └ id_number
  • Number
  • 可选
  • 0
  • 字块序号
  • └ need_fusion
  • Boolean
  • 可选
  • true
  • 是否需要合图
  • └ need_translate
  • Boolean
  • 可选
  • true
  • 是否需要翻译
  • └ src_lang
  • String
  • 可选
  • zh
  • 用户期待翻译的源语种
  • └ sid
  • String
  • 可选
  • 2d32d1
  • 唯一标识
  • └ height
  • Number
  • 可选
  • 800
  • 图片旋转后高度

响应参数

名称 类型 示例值 描述
ocr_result_dto OcrResultDTO 顺滑结果对象
  • └ org_width
  • Number
  • 882
  • 原始图片宽度
  • └ width
  • Number
  • 882
  • 图片旋转后宽度
  • └ word_num
  • Number
  • 2
  • 字块数量
  • └ angle
  • Number
  • 0
  • 图片旋转角度
  • table_info_dto_list
  • OcrTableInfoDTO []
  • 表格对象信息列表
  • cell_infos
  • OcrTableCellInfoDTO []
  • 单元格信息
  • pos
  • Coord []
  • 坐标信息
  • └ x
  • Number
  • 1
  • 横坐标
  • └ y
  • Number
  • 3
  • 纵坐标
  • └ yec
  • Number
  • 2
  • 表示纵向,结束是第几个表格
  • └ xec
  • Number
  • 1
  • 表示横向,结束是第几个表格
  • └ ysc
  • Number
  • 2
  • 表示纵向,开始是第几个表格
  • └ table_cell_id
  • Number
  • 1
  • 表格单元格ID
  • └ xsc
  • Number
  • 1
  • xStartItem缩写,表示横向,开始是第几个表格
  • └ word
  • String
  • 你好
  • 文字内容
  • └ x_cell_size
  • Number
  • 4
  • 横向单元格长度
  • └ table_id
  • Number
  • 0
  • 表格ID
  • └ y_cell_size
  • Number
  • 3
  • 纵向单元格长度
  • └ org_height
  • Number
  • 800
  • 原始图片高度
  • └ trg_lang
  • String
  • en
  • 目标语种
  • ocr_coord_dto_list
  • OcrCoordDTO []
  • OCR字块坐标对象列表
  • down_left
  • Coord
  • 左下角坐标
  • └ x
  • Number
  • 14
  • 左下角横坐标
  • └ y
  • Number
  • 657
  • 左下角纵坐标
  • └ confidence
  • String
  • 0.99
  • 置信度,范围0~1
  • up_right
  • Coord
  • 右上角坐标
  • └ x
  • Number
  • 595
  • 右上角横坐标
  • └ y
  • Number
  • 604
  • 右上角纵坐标
  • up_left
  • Coord
  • 左上角坐标
  • └ x
  • Number
  • 14
  • 左上角横坐标
  • └ y
  • Number
  • 604
  • 左上角纵坐标
  • down_right
  • Coord
  • 右下角坐标
  • └ x
  • Number
  • 595
  • 右下角横坐标
  • └ y
  • Number
  • 657
  • 右下角纵坐标
  • └ table_id
  • Number
  • 0
  • 表格ID
  • └ table_cell_id
  • Number
  • 0
  • 表格单元格ID
  • └ text
  • String
  • 一件包邮送头饰团扇眉心贴
  • 识别文本
  • └ direction
  • Number
  • 0
  • 文字方向:0.横行,1.竖行
  • └ in_entity
  • Boolean
  • false
  • 是否在实体内
  • └ id_number
  • Number
  • 0
  • 字块序号
  • └ need_fusion
  • Boolean
  • true
  • 是否需要合图
  • └ need_translate
  • Boolean
  • true
  • 是否需要翻译
  • └ src_lang
  • String
  • zh
  • 用户期待翻译的源语种
  • └ sid
  • String
  • 23fe23q1
  • 唯一标识
  • └ height
  • Number
  • 800
  • 图片旋转后高度

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIntlTranslationplatformTextsmoothGetRequest req = new AlibabaIntlTranslationplatformTextsmoothGetRequest();
AlibabaIntlTranslationplatformTextsmoothGetRequest.TextSmoothParamDTO obj1 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.TextSmoothParamDTO();
obj1.setSourceLang("zh");
obj1.setAppName("cloud_alimtct_it_ecommerce");
obj1.setContextId("3e1c6b0d48c3446ea5658078c4438db6");
AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrResultDTO obj2 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrResultDTO();
obj2.setOrgWidth(882L);
obj2.setWidth(882L);
obj2.setWordNum(2L);
obj2.setAngle(0L);
List<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableInfoDTO> list4 = new ArrayList<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableInfoDTO>();
AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableInfoDTO obj5 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableInfoDTO();
list4.add(obj5);
List<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableCellInfoDTO> list8 = new ArrayList<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableCellInfoDTO>();
AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableCellInfoDTO obj9 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrTableCellInfoDTO();
list8.add(obj9);
List<AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord> list12 = new ArrayList<AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord>();
AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord obj13 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord();
list12.add(obj13);
obj13.setX(1L);
obj13.setY(1L);
list10.setPos(list12);
obj9.setYec(2L);
obj9.setXec(2L);
obj9.setYsc(1L);
obj9.setTableCellId(1L);
obj9.setXsc(1L);
obj9.setWord("Hello");
list6.setCellInfos(list8);
obj5.setXCellSize(0L);
obj5.setTableId(0L);
obj5.setYCellSize(0L);
obj2.setTableInfoDtoList(list4);
obj2.setOrgHeight(800L);
obj2.setTrgLang("en");
List<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrCoordDTO> list15 = new ArrayList<AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrCoordDTO>();
AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrCoordDTO obj16 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.OcrCoordDTO();
list15.add(obj16);
AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord obj18 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord();
obj18.setX(14L);
obj18.setY(657L);
list17.setDownLeft(obj18);
obj16.setConfidence("0.99");
AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord obj20 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord();
obj20.setX(595L);
obj20.setY(604L);
list19.setUpRight(obj20);
AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord obj22 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord();
obj22.setX(14L);
obj22.setY(604L);
list21.setUpLeft(obj22);
AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord obj24 = new AlibabaIntlTranslationplatformTextsmoothGetRequest.Coord();
obj24.setX(595L);
obj24.setY(657L);
list23.setDownRight(obj24);
obj16.setTableId(0L);
obj16.setTableCellId(0L);
obj16.setText("一件包邮送头饰团扇眉心贴");
obj16.setDirection(0L);
obj16.setInEntity(false);
obj16.setIdNumber(0L);
obj16.setNeedFusion(true);
obj16.setNeedTranslate(true);
obj2.setOcrCoordDtoList(list15);
obj2.setSrcLang("zh");
obj2.setSid("2d32d1");
obj2.setHeight(800L);
obj1.setOcrResultDto(obj2);
req.setTextSmoothParamDto(obj1);
AlibabaIntlTranslationplatformTextsmoothGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_intl_translationplatform_textsmooth_get_response>
    <ocr_result_dto>
        <org_width>882</org_width>
        <width>882</width>
        <word_num>2</word_num>
        <angle>0</angle>
        <table_info_dto_list>
            <ocr_table_info_d_t_o>
                <cell_infos>
                    <ocr_table_cell_info_d_t_o>
                        <pos>
                            <coord>
                                <x>1</x>
                                <y>3</y>
                            </coord>
                        </pos>
                        <yec>2</yec>
                        <xec>1</xec>
                        <ysc>2</ysc>
                        <table_cell_id>1</table_cell_id>
                        <xsc>1</xsc>
                        <word>你好</word>
                    </ocr_table_cell_info_d_t_o>
                </cell_infos>
                <x_cell_size>4</x_cell_size>
                <table_id>0</table_id>
                <y_cell_size>3</y_cell_size>
            </ocr_table_info_d_t_o>
        </table_info_dto_list>
        <org_height>800</org_height>
        <trg_lang>en</trg_lang>
        <ocr_coord_dto_list>
            <ocr_coord_d_t_o>
                <down_left>
                    <x>14</x>
                    <y>657</y>
                </down_left>
                <confidence>0.99</confidence>
                <up_right>
                    <x>595</x>
                    <y>604</y>
                </up_right>
                <up_left>
                    <x>14</x>
                    <y>604</y>
                </up_left>
                <down_right>
                    <x>595</x>
                    <y>657</y>
                </down_right>
                <table_id>0</table_id>
                <table_cell_id>0</table_cell_id>
                <text>一件包邮送头饰团扇眉心贴</text>
                <direction>0</direction>
                <in_entity>false</in_entity>
                <id_number>0</id_number>
                <need_fusion>true</need_fusion>
                <need_translate>true</need_translate>
            </ocr_coord_d_t_o>
        </ocr_coord_dto_list>
        <src_lang>zh</src_lang>
        <sid>23fe23q1</sid>
        <height>800</height>
    </ocr_result_dto>
</alibaba_intl_translationplatform_textsmooth_get_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部