资讯 社区 文档
技术能力
语音技术
文字识别
人脸与人体
图像技术
语言与知识
视频技术

API文档

在线调试

您可以在 示例代码中心 中调试该接口,可进行签名验证、查看在线调用的请求内容和返回结果、示例代码的自动生成。

请求说明

请求示例

HTTP 方法:POST

请求URL: https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance

URL参数:

参数
access_token 通过API Key和Secret Key获取的access_token,参考“Access Token获取

Header如下:

参数
Content-Type application/x-www-form-urlencoded

Body中放置请求参数,参数详情如下:

请求参数

参数 是否必选 类型 可选值范围 说明
image 和 url/pdf_file 三选一 string - 图像数据,base64编码后进行urlencode,需去掉编码头(data:image/jpeg;base64, )
要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式
url 和 image/pdf_file 三选一 string - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式,当image字段存在时url字段失效
请注意关闭URL防盗链
pdf_file 和 image/url 三选一 string - PDF文件,base64编码后进行urlencode,需去掉编码头(data:application/pdf;base64, )
要求base64编码和urlencode后大小不超过4M
注:目前仅支持单页PDF识别,如上传的为多页PDF,仅识别第一页
templateSign string - 模板 ID,自定义模板或预置模板的唯一标示,可用于调用指定的识别模板进行结构化识别,可在「模板管理」页查看并复制使用
classifierId string - 分类器Id,分类器的唯一标示,可用于调用指定的分类器对传入的图片进行自动分类及识别
与 templateSign 至少存在一个,如同时存在,则优先级 templateSign > classfierId

请求代码示例

提示一:使用示例代码前,请记得替换其中的示例Token、图片地址或Base64信息。

提示二:部分语言依赖的类或库,请在代码注释中查看下载地址。

# 请求模板id
curl -i -k 'https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance?access_token=【调用鉴权接口获取的token】' --data 'templateSign=xxx&image=【图片Base64编码,需UrlEncode】' -H 'Content-Type:application/x-www-form-urlencoded'
# 请求分类器id
curl -i -k 'https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance?access_token=【调用鉴权接口获取的token】' --data 'classifierId=xxx&image=【图片Base64编码,需UrlEncode】' -H 'Content-Type:application/x-www-form-urlencoded'
# -*- coding:UTF-8 -*-
# -*- encoding: utf-8 -*-
import base64
import requests

if sys.version_info.major == 2:
    from urllib import quote
else:
    from urllib.parse import quote


headers = {
        'Content-Type': "application/x-www-form-urlencoded",
        'charset': "utf-8"
    }
if __name__ == '__main__':
    # 代码中所需的工具包requests
    # 安装方式:pip install requests
    # iocr识别api_url
    recognise_api_url = "https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance"


    access_token = "your_access_token"
    templateSign = "your_templateSign"
    detectorId = 0
    classifierId = "your_classifier_id"
    # 测试数据路径
    image_path = "your_file_path"
    try:
        with open(image_path, 'rb') as f:
            image_data = f.read()
        
        if sys.version_info.major == 2:
            image_b64 = base64.b64encode(image_data).replace("\r", "")
        else:
            image_b64 = base64.b64encode(image_data).decode().replace("\r", "")
        
        # 请求模板的bodys
        recognise_bodys = "access_token=" + access_token + "&templateSign=" + templateSign + \
                "&image=" + quote(image_b64.encode("utf8"))
        # 请求分类器的bodys
        classifier_bodys = "access_token=" + access_token + "&classifierId=" + classifierId + \
                "&image=" + quote(image_b64.encode("utf8"))
        # 请求模板识别
        response = requests.post(recognise_api_url, data=recognise_bodys, headers=headers)
        # 请求分类器识别
        # response = requests.post(recognise_api_url, data=classifier_bodys, headers=headers)
        print response.text
    except Exception as e:
        print e
package com.baidu.ocr;

import com.baidu.ai.aip.utils.Base64Util;
import com.baidu.ai.aip.utils.FileUtil;
import com.baidu.ai.aip.utils.HttpUtil;


public class App 
{
    public static void main(String[] args) throws Exception
    {
        /**
         * 重要提示代码中所需工具类
         * FileUtil,Base64Util,HttpUtil,GsonUtils请从
         * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
         * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
         * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
         * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
         * 下载
         */
        // iocr识别apiUrl
        String recogniseUrl = "https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance";


        String filePath = "path\to\your\image.jpg";
        try {
                byte[] imgData = FileUtil.readFileByBytes(filePath);
                String imgStr = Base64Util.encode(imgData);
                // 请求模板参数
                String recogniseParams = "templateSign=your_template_sign&image=" + URLEncoder.encode(imgStr, "UTF-8");
                // 请求分类器参数
                String classifierParams = "classifierId=your_classfier_id&image=" + URLEncoder.encode(imgStr, "UTF-8");
                
                
                String accessToken = "your_access_token";
                // 请求模板识别
                String result = HttpUtil.post(recogniseUrl, accessToken, recogniseParams);
                // 请求分类器识别
                // String result = HttpUtil.post(recogniseUrl, accessToken, classifierParams);
                
                System.out.println(result);
        } catch (Exception e) {
                e.printStackTrace();
        }
    }
}
#include <iostream>
#include "curl_install/include/curl/curl.h"
#include <fstream>
#include "Base64.h"
#include <cctype>
#include <iomanip>
#include <sstream>
#include <string>

using namespace std;
// libcurl库下载链接:https://curl.haxx.se/download.html
// 通用iocr的接口url
static string ocr_result;
/**
 * curl发送http请求调用的回调函数,回调函数中对返回的json格式的body进行了解析,解析结果储存在全局的静态变量当中
 * @param 参数定义见libcurl文档
 * @return 返回值定义见libcurl文档
 */
static size_t callback(void *ptr, size_t size, size_t nmemb, void *stream) {
    // 获取到的body存放在ptr中,先将其转换为string格式
    ocr_result = string((char *) ptr, size * nmemb);
    return size * nmemb;
}

string url_encode(const std::string &value) {
    ostringstream escaped;
    escaped.fill('0');
    escaped << hex;
    for (std::string::const_iterator i = value.begin(), n = value.end(); i != n; ++i) {
        std::string::value_type c = (*i);
        // Keep alphanumeric and other accepted characters intact
        if (isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') {
            escaped << c;
            continue;
        }
        // Any other characters are percent-encoded
        escaped << uppercase;
        escaped << '%' << setw(2) << int((unsigned char) c);
        escaped << nouppercase;
    }

    return escaped.str();
}
// base64.h下载地址
// https://bj.bcebos.com/v1/iocr-movie/Base64.h
int iocr_regenize(const std::string &image_base64, const std::string &access_token, const std::string &templateSign, 
    const std::int classifierId, const std::int detectorId) {
    // iocr识别apiUrl
    const static string recognise_api_url = "https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance";
    // 请求模板的参数
    std::string recognise_params = "access_token=" + access_token + "&templateSign=" + templateSign + "&image=" + image_base64;

    // 请求分类器的参数
    std::string classifier_params = "access_token=" + access_token 
        + "&classifierId=" + std::to_string(classifierId) 
        + "&image=" + image_base64;
    
    struct curl_slist * headers = NULL;
    headers = curl_slist_append(headers, "Content-Type:application/x-www-form-urlencoded");
    headers = curl_slist_append(headers, "charset:utf-8");
    CURL *curl;
    CURLcode result_code;
    int is_success;
    curl = curl_easy_init();
    if (curl) {
        // 使用libcurl post数据:设定待post的url等
        curl_easy_setopt(curl, CURLOPT_URL, recognise_api_url.c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_POST, 1);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,callback);
        // 请求模板
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, recognise_params.c_str());
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, recognise_params.size());
        // 请求分类器
        // curl_easy_setopt(curl, CURLOPT_POSTFIELDS, classifier_params.c_str());
        // curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, classifier_params.size());
        result_code = curl_easy_perform(curl);
        // http post不成功时错误处理
        if (result_code != CURLE_OK) {
            fprintf(stderr, "curl_easy_perform() failed: %s\n",
                    curl_easy_strerror(result_code));
            is_success = 1;
            return is_success;
        }
        curl_easy_cleanup(curl);
        curl_slist_free_all(headers);
        // 控制台输出识别结果
        cout << ocr_result << endl;
        is_success = 0;
    } else {
        fprintf(stderr, "curl_easy_init() failed.");
        is_success = 1;
    }
    return is_success;
}

std::string get_image_b64(const std::string &image_path) {
    ifstream f;
    f.open(image_path, ios::in | ios::binary);
    // 定位指针到文件末尾
    f.seekg(0, ios::end);
    int size = f.tellg();
    // 指针重新回到文件头部
    f.seekg(0, ios::beg);
    char* buffer = (char*)malloc(sizeof(char)*size);
    f.read(buffer,size);
    f.close();
    // base64编码
    std::string image_b64 = base64_encode(buffer, size);
    return image_b64;
}

int main() {
    std::string access_token = "your_access_token";
    std::string image_path = "your_file_path";
    std::string templateSign = "your_templateSign";
    std::int classifierId = "your_classifier_id";
    std::int detectorId = 0;
    // 获取本地图片的base64
    std::string image_b64 = get_image_b64(image_path);
    // urlcode编码
    image_b64 = url_encode(image_b64);
    // 发送post请求
    iocr_regenize(image_b64, access_token, templateSign, classifierId, detectorId);
    return 0;
}
<?php
/**
 * 发起http post请求(REST API), 并获取REST请求的结果
 * @param string $url
 * @param string $param
 * @return - http response body if succeeds, else false.
 */
function request_post($url = '', $params = '')
{
    if (empty($url) || empty($params)) {
        return false;
    }
    $headers = array("Content-Type" => "application/x-www-form-urlencoded", "charset" => "utf-8");
    // 初始化curl
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    // 要求结果为字符串且输出到屏幕上
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    // post提交方式
    //curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
    // 运行curl
    $data = curl_exec($curl);
    curl_close($curl);

    return $data;
}

function get_image_b64($image_path = '')
{
    $image_b64 = '';
    if(file_exists($image_path)) {
        $image_data = file_get_contents($image_path);
        print("file exists\n");
        $image_b64_tmp = base64_encode($image_data);
        $image_b64 = urlencode($image_b64_tmp);
        //print($image_b64);
    } else {
        print("file doesn't exists\n");
    }
    return $image_b64;
}
// iocr识别api_url
$recognise_api_url = "https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance";


$access_token = "your_access_token";
$templateSign = "your_templateSign";
$detectorId = 0;
$classifierId = "your_classifier_id";
$image_path = "your_file_path";
$image_b64 = get_image_b64($image_path);
// iocr识别bodys
$recognise_bodys = "access_token=". $access_token. "&templateSign=". $templateSign. "&image=". $image_b64;
# 分类器请求的bodys
$classifier_bodys = "access_token=". $access_token. "&classifierId=". $classifierId. "&image=". $image_b64;
# 请求模板
$response = request_post($recognise_api_url, $recognise_bodys);
# 请求分类器
# $response = request_post($recognise_api_url, $classifier_bodys);

var_dump($response)
?>
using System;
using System.Net;
using System.IO;
using System.Text;
using System.Web;

namespace iocr_api_demo
{
    class IocrApiDemo
    {
        static void Main(String[] args)
        {
            PostHttp();
        }
        public static void PostHttp(){
            // fileUtils.cs 类下载地址
            // https://bj.bcebos.com/v1/iocr-movie/FileUtils.cs
            // iocr识别api_url
            String recognise_api_url = "https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise/finance";
            
            String access_token = "your_access_token";
            String image_path = "your_file_path";
            String image_b64 = FileUtils.getFileBase64(image_path);
            // iocr按模板id识别的请求bodys
            string templateSign = "yout_templateSign";
            string recognise_bodys = "access_token=" + access_token + "&templateSign=" + templateSign + 
                            "&image=" + HttpUtility.UrlEncode(image_b64);
            // iocr按分类器id识别的请求bodys
            int classifierId = "your_classifier_id";
            String classifier_bodys = "access_token=" + access_token + "&classifierId=" + classifierId + "&image=" + HttpUtility.UrlEncode(image_b64);

            HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(recognise_api_url);
            httpWebRequest.ContentType = "application/x-www-form-urlencoded";
            httpWebRequest.Method = "POST";
            httpWebRequest.KeepAlive = true;
            try{
                // 请求模板id
                byte[] btBodys = Encoding.UTF8.GetBytes(recognise_bodys);
                // 请求分类器id
                // byte[] btBodys = Encoding.UTF8.GetBytes(classifier_bodys);
                httpWebRequest.ContentLength = btBodys.Length;
                httpWebRequest.GetRequestStream().Write(btBodys, 0, btBodys.Length);
                HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
                StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream());
                string responseContent = streamReader.ReadToEnd();
                Console.WriteLine(responseContent);
                httpWebResponse.Close();
                streamReader.Close();
                httpWebRequest.Abort();
                httpWebResponse.Close();
            } catch (Exception e){
                Console.Write(e.Message);
            }    
        }
    }
}

返回说明

返回参数

字段 是否必选 类型 说明
logid uint64 唯一的log id,用于问题定位
error_code int 0代表成功,如果有错误码返回可以参考下方错误码列表排查问题
error_msg string 如果error_code具体的失败信息,可以参考下方错误码列表排查问题
data jsonObject 识别返回的结果
+ ret jsonArray 识别出来的字段数组,每一个单元里包含以下几个元素
++ word_name string isStructured 为 true 时存在,表示字段的名字;如果 isStructured 为 false 时,不存在
++ word string 识别的字符串或单字
++ location jsonObject 字段在原图上对应的矩形框位置,通过上边距、左边距、宽度、高度表示
++ probability jsonObject 字段的置信度,包括平均、最小和方差
+ templateSign string 图片分类结果对应的模板id或指定使用的模版id。templateSign的对应关系为:
- mixed_receipt:混贴发票,可对粘贴单中的多张不同票据进行检测分类,返回每张发票的类别及识别结果;
- vat_invoice:增值税发票;
- taxi_receipt:出租车票;
- roll_ticket:卷票;
- train_ticket:火车票;
- quota_invoice:定额发票;
- air_ticket:行程单;
- car_invoice:汽车票;
- toll_invoice:通行费发票;
- printed_invoice:机打发票。
+ scores float 分类置信度,如果指定templateSign,则该值为1
+ isStructured string 表示是否结构化成功,true为成功,false为失败;成功时,返回结构化的识别结果;失败时,如果能识别,按行返回结果,如果不能识别,返回空

返回示例

  • 使用自定义模板及自定义分类器功能时,返回结果可参考 iOCR通用版-返回示例
  • templateSign = mixed_receipt 时,返回结果如下所示:
{
	"data": {
		"ret": [
			{
				"ret": [
					{
						"rect": {
							"top": 277,
							"left": 237,
							"width": 61,
							"height": 10
						},
						"probability": {
							"average": 0.98831981420517,
							"min": 0.96548694372177
						},
						"word_name": "AmountInWords",
						"word": "叁佰陆拾圆整"
					},
					{
						"rect": {
							"top": 29,
							"left": 482,
							"width": 85,
							"height": 18
						},
						"probability": {
							"average": 0.99745708703995,
							"min": 0.99514311552048
						},
						"word_name": "InvoiceNumConfirm",
						"word": "07286261"
					},
					{
						"rect": {
							"top": 352,
							"left": 393,
							"width": 32,
							"height": 12
						},
						"probability": {
							"average": 0.99022936820984,
							"min": 0.98398983478546
						},
						"word_name": "NoteDrawer",
						"word": "余佳燕"
					},
					{
						"rect": {
							"top": 326,
							"left": 158,
							"width": 214,
							"height": 10
						},
						"probability": {
							"average": 0.94039279222488,
							"min": 0.39105615019798
						},
						"word_name": "SellerAddress",
						"word": "杭州市转塘科技经济区块16号8幢0571-85022088"
					},
					{
						"rect": {
							"top": 311,
							"left": 171,
							"width": 146,
							"height": 12
						},
						"probability": {
							"average": 0.99681425094604,
							"min": 0.98468536138535
						},
						"word_name": "SellerRegisterNum",
						"word": "91330106673959654P"
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "MachineCode",
						"word": ""
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "Remarks",
						"word": ""
					},
					{
						"rect": {
							"top": 339,
							"left": 158,
							"width": 181,
							"height": 11
						},
						"probability": {
							"average": 0.99247741699219,
							"min": 0.8911309838295
						},
						"word_name": "SellerBank",
						"word": "招商银行杭州高新支行502905023610702"
					},
					{
						"rect": {
							"top": 259,
							"left": 576,
							"width": 43,
							"height": 10
						},
						"probability": {
							"average": 0.97683322429657,
							"min": 0.89436012506485
						},
						"word_name": "TotalTax",
						"word": "20.38"
					},
					{
						"rect": {
							"top": 32,
							"left": 124,
							"width": 101,
							"height": 16
						},
						"probability": {
							"average": 0.99661940336227,
							"min": 0.99573355913162
						},
						"word_name": "InvoiceCodeConfirm",
						"word": "3321192130"
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "CheckCode",
						"word": ""
					},
					{
						"rect": {
							"top": 32,
							"left": 124,
							"width": 101,
							"height": 16
						},
						"probability": {
							"average": 0.99661940336227,
							"min": 0.99573355913162
						},
						"word_name": "InvoiceCode",
						"word": "3321192130"
					},
					{
						"rect": {
							"top": 65,
							"left": 534,
							"width": 73,
							"height": 12
						},
						"probability": {
							"average": 0.99508810043335,
							"min": 0.97497177124023
						},
						"word_name": "InvoiceDate",
						"word": "2019年08月28日"
					},
					{
						"rect": {
							"top": 104,
							"left": 168,
							"width": 147,
							"height": 12
						},
						"probability": {
							"average": 0.9933996796608,
							"min": 0.96598559617996
						},
						"word_name": "PurchaserRegisterNum",
						"word": "91110911717743469K"
					},
					{
						"rect": {
							"top": 18,
							"left": 257,
							"width": 164,
							"height": 19
						},
						"probability": {
							"average": 0.99611341953278,
							"min": 0.98104286193848
						},
						"word_name": "InvoiceTypeOrg",
						"word": "浙江增值税专用发票"
					},
					{
						"rect": {
							"top": 93,
							"left": 405,
							"width": 191,
							"height": 45
						},
						"probability": {
							"average": 0.97755342721939,
							"min": 0.82740485668182
						},
						"word_name": "Password",
						"word": "508>3909>1*>01/-46709-6/3+*7+8>/1*19+7-0**>+58290-6>647-+324865*9*1<*2191/7754/<0>2<838+//5-69--748*<251408<"
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "Agent",
						"word": "否"
					},
					{
						"rect": {
							"top": 278,
							"left": 511,
							"width": 54,
							"height": 10
						},
						"probability": {
							"average": 0.95414996147156,
							"min": 0.68566131591797
						},
						"word_name": "AmountInFiguers",
						"word": "360.00"
					},
					{
						"rect": {
							"top": 134,
							"left": 159,
							"width": 204,
							"height": 11
						},
						"probability": {
							"average": 0.97773444652557,
							"min": 0.61343103647232
						},
						"word_name": "PurchaserBank",
						"word": "招商银行北京分行大电路支行866180100210002"
					},
					{
						"rect": {
							"top": 352,
							"left": 259,
							"width": 26,
							"height": 12
						},
						"probability": {
							"average": 0.98384791612625,
							"min": 0.97088402509689
						},
						"word_name": "Checker",
						"word": "柳余"
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "City",
						"word": ""
					},
					{
						"rect": {
							"top": 258,
							"left": 460,
							"width": 49,
							"height": 11
						},
						"probability": {
							"average": 0.98758614063263,
							"min": 0.9416212439537
						},
						"word_name": "TotalAmount",
						"word": "339.62"
					},
					{
						"rect": {
							"top": 90,
							"left": 159,
							"width": 150,
							"height": 12
						},
						"probability": {
							"average": 0.96976244449615,
							"min": 0.70321601629257
						},
						"word_name": "PurchaserName",
						"word": "百度在线网络技术(北京)有限公司"
					},
					{
						"rect": {
							"top": 0,
							"left": 0,
							"width": -1,
							"height": -1
						},
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "Province",
						"word": "浙江"
					},
					{
						"rect": {
							"top": 18,
							"left": 257,
							"width": 164,
							"height": 19
						},
						"probability": {
							"average": 0.99611341953278,
							"min": 0.98104286193848
						},
						"word_name": "InvoiceType",
						"word": "专用发票"
					},
					{
						"rect": {
							"top": 145,
							"left": 626,
							"width": 9,
							"height": 28
						},
						"probability": {
							"average": 0.99723851680756,
							"min": 0.99662339687347
						},
						"word_name": "SheetNum",
						"word": "第二联"
					},
					{
						"rect": {
							"top": 119,
							"left": 159,
							"width": 158,
							"height": 12
						},
						"probability": {
							"average": 0.89263164997101,
							"min": 0.21246993541718
						},
						"word_name": "PurchaserAddress",
						"word": "北京市海淀区上地十侧10号百厘大厦三座"
					},
					{
						"rect": {
							"top": 353,
							"left": 113,
							"width": 22,
							"height": 10
						},
						"probability": {
							"average": 0.84802502393723,
							"min": 0.560218334198
						},
						"word_name": "Payee",
						"word": "佳机"
					},
					{
						"rect": {
							"top": 298,
							"left": 158,
							"width": 85,
							"height": 11
						},
						"probability": {
							"average": 0.96288979053497,
							"min": 0.8344641327858
						},
						"word_name": "SellerName",
						"word": "阿里云计算有限公司"
					},
					{
						"rect": {
							"top": 29,
							"left": 482,
							"width": 85,
							"height": 18
						},
						"probability": {
							"average": 0.99745708703995,
							"min": 0.99514311552048
						},
						"word_name": "InvoiceNum",
						"word": "07286261"
					},
					{
						"rect": {
							"top": 163,
							"left": 71,
							"width": 116,
							"height": 11
						},
						"probability": {
							"average": 0.9905007481575,
							"min": 0.98428183794022
						},
						"word_name": "DetailsOfTax#1#CommodityName",
						"word": "*信息技术服务*软件服务费"
					},
					{
						"word_name": "DetailsOfTax#1#CommodityType",
						"word": ""
					},
					{
						"rect": {
							"top": 164,
							"left": 292,
							"width": 10,
							"height": 10
						},
						"probability": {
							"average": 0.89159053564072,
							"min": 0.80279469490051
						},
						"word_name": "DetailsOfTax#1#CommodityUnit",
						"word": "套"
					},
					{
						"rect": {
							"top": 166,
							"left": 360,
							"width": 7,
							"height": 8
						},
						"probability": {
							"average": 0.95917397737503,
							"min": 0.95113134384155
						},
						"word_name": "DetailsOfTax#1#CommodityNum",
						"word": "1"
					},
					{
						"rect": {
							"top": 165,
							"left": 397,
							"width": 28,
							"height": 9
						},
						"probability": {
							"average": 0.97336208820343,
							"min": 0.89550644159317
						},
						"word_name": "DetailsOfTax#1#CommodityPrice",
						"word": "339.62"
					},
					{
						"rect": {
							"top": 165,
							"left": 480,
							"width": 28,
							"height": 9
						},
						"probability": {
							"average": 0.98559606075287,
							"min": 0.96932607889175
						},
						"word_name": "DetailsOfTax#1#CommodityAmount",
						"word": "339.62"
					},
					{
						"rect": {
							"top": 165,
							"left": 522,
							"width": 11,
							"height": 9
						},
						"probability": {
							"average": 0.92075562477112,
							"min": 0.8382123708725
						},
						"word_name": "DetailsOfTax#1#CommodityTaxRate",
						"word": "6%"
					},
					{
						"rect": {
							"top": 165,
							"left": 595,
							"width": 24,
							"height": 9
						},
						"probability": {
							"average": 0.97626549005508,
							"min": 0.9149768948555
						},
						"word_name": "DetailsOfTax#1#CommodityTax",
						"word": "20.38"
					}
				],
				"receiptCoordinate": "{\"height\":642,\"left\":155,\"top\":178,\"width\":1106}",
				"error_msg": "success",
				"templateSign": "vat_invoice",
				"scores": 1,
				"templateName": "增值税发票",
				"isStructured": true,
				"error_code": 0
			},
			{
				"ret": [
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "PickupTime",
						"word": "16:50"
					},
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "DropoffTime",
						"word": "17:06"
					},
					{
						"rect": {
							"top": 212,
							"left": 48,
							"width": 66,
							"height": 9
						},
						"probability": {
							"average": 0.98931306600571,
							"min": 0.92181307077408
						},
						"word_name": "Time",
						"word": "16:50-17:06"
					},
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "City",
						"word": ""
					},
					{
						"rect": {
							"top": 288,
							"left": 84,
							"width": 30,
							"height": 9
						},
						"probability": {
							"average": 0.99606895446777,
							"min": 0.99255055189133
						},
						"word_name": "FuelOilSurcharge",
						"word": "1.00"
					},
					{
						"rect": {
							"top": 198,
							"left": 53,
							"width": 61,
							"height": 9
						},
						"probability": {
							"average": 0.99483448266983,
							"min": 0.98498445749283
						},
						"word_name": "Date",
						"word": "2019-03-20"
					},
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "Province",
						"word": "陕西省"
					},
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "CallServiceSurcharge",
						"word": "0.00"
					},
					{
						"rect": {
							"top": 275,
							"left": 76,
							"width": 38,
							"height": 9
						},
						"probability": {
							"average": 0.98517167568207,
							"min": 0.97685235738754
						},
						"word_name": "Fare",
						"word": "21.10"
					},
					{
						"rect": {
							"top": 314,
							"left": 76,
							"width": 39,
							"height": 9
						},
						"probability": {
							"average": 0.97668653726578,
							"min": 0.93554848432541
						},
						"word_name": "TotalFare",
						"word": "2.00"
					},
					{
						"rect": {
							"top": 173,
							"left": 72,
							"width": 42,
							"height": 8
						},
						"probability": {
							"average": 0.98336416482925,
							"min": 0.88234621286392
						},
						"word_name": "TaxiNum",
						"word": "BQ6353"
					},
					{
						"rect": {
							"top": 225,
							"left": 89,
							"width": 25,
							"height": 8
						},
						"probability": {
							"average": 0.99482887983322,
							"min": 0.99453765153885
						},
						"word_name": "PricePerkm",
						"word": "2.30"
					},
					{
						"rect": {
							"top": 124,
							"left": 14,
							"width": 90,
							"height": 11
						},
						"probability": {
							"average": 0.99889290332794,
							"min": 0.99876511096954
						},
						"word_name": "InvoiceCode",
						"word": "161001881016"
					},
					{
						"rect": {
							"top": 238,
							"left": 96,
							"width": 18,
							"height": 8
						},
						"probability": {
							"average": 0.99126571416855,
							"min": 0.98285579681396
						},
						"word_name": "Distance",
						"word": "6.0"
					},
					{
						"rect": {
							"top": 137,
							"left": 14,
							"width": 60,
							"height": 10
						},
						"probability": {
							"average": 0.99211621284485,
							"min": 0.94001615047455
						},
						"word_name": "InvoiceNum",
						"word": "05070716"
					},
					{
						"probability": {
							"average": 0,
							"min": 0
						},
						"word_name": "Location",
						"word": "陕西省"
					}
				],
				"receiptCoordinate": "{\"height\":618,\"left\":1325,\"top\":200,\"width\":215}",
				"error_msg": "success",
				"templateSign": "taxi",
				"scores": 1,
				"templateName": "出租车发票",
				"isStructured": true,
				"error_code": 0
			}
		],
		"templateSign": "mixed_receipt",
		"templateName": "混贴票据",
		"scores": 1,
		"isStructured": true,
		"logId": "164196999300761",
		"version": 1
	},
	"error_code": 0,
	"error_msg": "",
	"log_id": "164196999300761"
}
上一篇
使用流程
下一篇
常见问题