python拍照搜题_OCR拍照搜题
OCR拍照搜题
简介
HI,您好,欢迎使用学而思网校AI开放平台OCR拍照搜题接口服务。
本文档主要针对需要集成HTTP API的技术研发工程师,详细描述OCR拍照搜题能力相关的技术内容。您可以通过
接口能力
接口名称
接口能力简要描述
api 地址
OCR拍照搜题
检测上传图像中的文字,进行 AI 文字识别,然后搜索相关的试题。
http://openapiai.xueersi.com/v1/api/img/ocr/photo_search
适用范围
任意操作系统,任意编程语言,均可以通过http或https调用本接口。
图像发送方式
图像数据支持两种形式发送:
URL
网络上的图片 URL 地址
图片数据
请求图片需经过base64编码:图片的base64编码指将一副图片编码成字符串数据,便于网络传输请求。您可以首先得到图片的二进制,进行base64编码后,然后再进行urlencode(注意你所使用的网络工具或网络库有没有默认的urlencode功能,如果没有,需要你自己显式转化)。
转码方式可参考
注意: 图片的base64编码是不包含图片头的,如(data:image/jpg;base64,)
图片大小
不能大于4MB
长边不能超过4096px
短边不能小于15px
图像类型支持
图像数据支持以下原生类型:
jpg
png
jpeg
bmp
文字识别范围
目前,OCR识别接口服务支持多种类型文字,包括:
中文打印体识别
英文打印体识别
表格识别
拼音识别
请求方式
HTTP 方法:POST
请求 URL:http://openapiai.xueersi.com/v1/api/img/ocr/photo_search
注意: Content-Type为application/x-www-form-urlencoded,然后通过urlencode格式化请求体。
Header 如下:
参数名
赋值
Content-Type
application/x-www-form-urlencoded
urlencode介绍
在请求 API 的 post 请求参数中含有图片url地址或base64字符。url地址 或 base64 字符作为参数传递时,需要把 中文 以及 '/' 做一下编码,防止解析中出现歧义,从而符合url的规范。
将中文 以及 '/' 转换为百分号编码形式,这就是 urlencode格式化操作。
部分语言的第三方包内部做了 urlencode 编码,不进行 urlencode 格式化也可以正常进行 API 请求,但 是进行 urlencode 格式化之后,一定可以通过请求。所以我们推荐您对请求体中的参数进行 urlencode 操作。
快速接入方式
请求参数详情
参数名
类型
是否必选
赋值说明
样例
备注
app_key
string
是
应用标识
8102b22a5e81e840176d9f381ec6f837
img
string
是
图像数据
https://i.loli.net/2019/03/22/5c94684fad743.jpg
或
图像 base64数据:示例数据较长,见附件
图像base64字符串 / 图像URL
img_type
string
是
图像形式
URL
base64 / URL
subject_id
integer
否
学科id
1:语文,2:数学,3:英语,4:物理,5:化学,6:生物,7:政治,8:历史,9:地理,20:趣味,21:科学,25:生化,26:编程,44:人文
默认0
请求代码示例
HTTP 代码示例:
POST /v1/api/img/ocr/photo_search HTTP/1.1
Host: openapiai.xueersi.com
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3a%2f%2fi.loli.net%2f2019%2f03%2f22%2f5c94684fad743.jpg&img_type=URL
cURL 代码示例:
curl -X POST \
http://openapiai.xueersi.com/v1/api/img/ocr/photo_search \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3a%2f%2fi.loli.net%2f2019%2f03%2f22%2f5c94684fad743.jpg&img_type=URL'
PHP 代码示例:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3a%2f%2fi.loli.net%2f2019%2f03%2f22%2f5c94684fad743.jpg&img_type=URL",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Python(Python3) 代码示例:
URL传参方式:
import http.client
conn = http.client.HTTPConnection("openapiai.xueersi.com")
payload = "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL"
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'cache-control': "no-cache",
}
conn.request("POST", "/v1/api/img/ocr/photo_search/", payload, headers)
res = conn.getresponse()
data = res.read()
#python2.7
#print(data)
#python3.6
print(data.decode("utf-8"))
conn.close()
base64传参方式:
import http.client
import urllib
import base64
from urllib import quote
with open('./test.jpg', 'rb') as bin_data:
image_data = bin_data.read()
image_data_base64 = base64.b64encode(image_data)
image_data_base64 = quote(image_data_base64)
conn = http.client.HTTPConnection("openapiai.xueersi.com")
appkey_string = 'app_key=8102b22a5e81e840176d9f381ec6f837'
img_string = 'img=' + image_data_base64
img_type_string = 'img_type=base64'
payload = appkey_string + '&' + img_string + '&' + img_type_string
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'cache-control': "no-cache",
}
conn.request("POST", "/v1/api/img/ocr/photo_search/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
C++(LibCurl) 代码示例:
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3a%2f%2fi.loli.net%2f2019%2f03%2f22%2f5c94684fad743.jpg&img_type=URL");
CURLcode ret = curl_easy_perform(hnd);
Java 代码示例:
public static void QuickConnect(){
new Thread(new Runnable() {
@Override
public void run() {
try {
Map params = new HashMap();
params.put("app_key", "8102b22a5e81e840176d9f381ec6f837");
params.put("img","https://i.loli.net/2019/03/22/5c94684fad743.jpg");
params.put("img_type","URL");
Log.i(TAG,"start post");
String result = HttpUtil.sendPostMessage(params,"utf-8");
System.out.println("result->"+result);
}catch(Exception e)
{
e.printStackTrace();
}
}
}).start();
}
JavaScript 代码示例:
var settings = {
"async": true,
"crossDomain": true,
"url": "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"cache-control": "no-cache",
},
"data": {
"app_key": "8102b22a5e81e840176d9f381ec6f837",
"img": "https://ai.xueersi.com/textRecognition/images/22.jpg",
"img_type": "URL"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Go 代码示例:
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search"
payload := strings.NewReader("app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("cache-control", "no-cache")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
C# 代码示例:
using System;
using System.IO;
using System.Net;
using System.Text;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string celerityPost = CelerityPost();
Console.WriteLine("快速接入方式:\n" + celerityPost);
Console.ReadLine();
}
private static string CelerityPost()
{
string url = "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search";//URL地址
string payload = "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL";
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.ContentLength = Encoding.UTF8.GetByteCount(payload);
webRequest.ContentType = "application/x-www-form-urlencoded";//Content-Type
webRequest.CookieContainer = cookieContainer;
webRequest.Method = "post";
Stream request = webRequest.GetRequestStream();
StreamWriter streamWriter = new StreamWriter(request, Encoding.GetEncoding("gb2312"));
streamWriter.Write(payload);
streamWriter.Close();
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
response.Cookies = cookieContainer.GetCookies(response.ResponseUri);
Stream returnStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(returnStream, Encoding.GetEncoding("utf-8"));
string endResult = streamReader.ReadToEnd();//返回结果
streamReader.Close();
returnStream.Close();
return endResult;
}
}
}
微信小程序 代码示例:
wx.request({
url: 'http://openapiai.xueersi.com/v1/api/img/ocr/photo_search',
method: "post",
data:
{
app_key: "8102b22a5e81e840176d9f381ec6f837",
img: "https://ai.xueersi.com/textRecognition/images/22.jpg",
img_type: "URL",
},
header: {
"content-type": "application/x-www-form-urlencoded",
},
success(res) {
console.log(res.data)
}
})
iOS 代码示例:
NSURLSession *session = [NSURLSession sharedSession];
NSString *urlStr = @"http://openapiai.xueersi.com/v1/api/img/ocr/photo_search";
NSURL *url = [NSURL URLWithString:urlStr];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
NSString *app_key = @"app_key=8102b22a5e81e840176d9f381ec6f837";
NSString *img = @"img=https://ai.xueersi.com/textRecognition/images/22.jpg";
NSString *img_type = @"img_type=URL";
NSString *paramsStr = [NSString stringWithFormat:@"%@&%@&%@", app_key, img, img_type];
request.HTTPBody = [paramsStr dataUsingEncoding:NSUTF8StringEncoding];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
NSLog(@"result=%@",dict);
}];
[dataTask resume];
安全接入方式
请求参数详情
参数名
类型
是否必选
赋值说明
样例
备注
app_key
string
是
应用标识
8102b22a5e81e840176d9f381ec6f837
time_stamp
string
是
秒级时间戳
1493468759
安全接入必备,用于唯一地标识某一刻的时间
nonce_str
string
是
随机字符串
dd599ef889859f9fe
安全接入必备
sign
string
是
签名信息
99880aabb33f4def5c875875b6bdc3b1
安全接入必备
img_type
string
是
图像形式
URL
base64 / URL
subject_id
integer
否
学科id
1:语文,2:数学,3:英语,4:物理,5:化学,6:生物,7:政治,8:历史,9:地理,20:趣味,21:科学,25:生化,26:编程,44:人文
默认0
请求代码示例
HTTP 代码示例:
POST /v1/api/img/ocr/photo_search HTTP/1.1
Host: openapiai.xueersi.com
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a
cURL 代码示例:
curl -X POST \
http://openapiai.xueersi.com/v1/api/img/ocr/photo_search \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'cache-control: no-cache' \
-d 'app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a'
PHP 代码示例:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Python(Python3) 代码示例:
URL传参方式:
import http.client
conn = http.client.HTTPConnection("openapiai.xueersi.com")
payload = "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a"
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'cache-control': "no-cache",
}
conn.request("POST", "/v1/api/img/ocr/photo_search/", payload, headers)
res = conn.getresponse()
data = res.read()
#python2.7
#print(data)
#python3.6
print(data.decode("utf-8"))
conn.close()
base64传参方式:
import http.client
import urllib
import base64
from urllib import quote
with open('./test.jpg', 'rb') as bin_data:
image_data = bin_data.read()
image_data_base64 = base64.b64encode(image_data)
image_data_base64 = quote(image_data_base64)
conn = http.client.HTTPConnection("openapiai.xueersi.com")
appkey_string = 'app_key=8102b22a5e81e840176d9f381ec6f837'
img_string = 'img=' + image_data_base64
img_type_string = 'img_type=base64'
payload = appkey_string + '&' + img_string + '&' + img_type_string + '&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a'
headers = {
'Content-Type': "application/x-www-form-urlencoded",
'cache-control': "no-cache",
}
conn.request("POST", "/v1/api/img/ocr/photo_search/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
C++(LibCurl) 代码示例:
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "cache-control: no-cache");
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a");
CURLcode ret = curl_easy_perform(hnd);
Java 代码示例:
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a");
Request request = new Request.Builder()
.url("http://openapiai.xueersi.com/v1/api/img/ocr/photo_search")
.post(body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
JavaScript 代码示例:
var settings = {
"async": true,
"crossDomain": true,
"url": "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search",
"method": "POST",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"cache-control": "no-cache",
},
"data": {
"app_key": "8102b22a5e81e840176d9f381ec6f837",
"img": "https://ai.xueersi.com/textRecognition/images/22.jpg",
"img_type": "URL",
"time_stamp": "1551174536",
"nonce_str": "W8FI8oCp",
"sign": "c08d8f9900479a3b2a348c1d7dc7e918e71be66a"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Go 代码示例:
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search"
payload := strings.NewReader("app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("cache-control", "no-cache")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
C# 代码示例:
using System;
using System.IO;
using System.Net;
using System.Text;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string safetyPost = SafetyPost();
Console.WriteLine("安全接入方式:\n" + safetyPost);
Console.ReadLine();
}
private static string SafetyPost()
{
string url = "http://openapiai.xueersi.com/v1/api/img/ocr/photo_search";//URL地址
string payload = "app_key=8102b22a5e81e840176d9f381ec6f837&img=https%3A%2F%2Fai.xueersi.com%2FtextRecognition%2Fimages%2F22.jpg&img_type=URL&time_stamp=1551174536&nonce_str=W8FI8oCp&sign=7d15e530e58fcf3a020ec69b48d951010fa49322";
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.ContentLength = Encoding.UTF8.GetByteCount(payload);
webRequest.ContentType = "application/x-www-form-urlencoded";//Content-Type
webRequest.CookieContainer = cookieContainer;
webRequest.Method = "post";
Stream request = webRequest.GetRequestStream();
StreamWriter streamWriter = new StreamWriter(request, Encoding.GetEncoding("gb2312"));
streamWriter.Write(payload);
streamWriter.Close();
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
response.Cookies = cookieContainer.GetCookies(response.ResponseUri);
Stream returnStream = response.GetResponseStream();
StreamReader streamReader = new StreamReader(returnStream, Encoding.GetEncoding("utf-8"));
string endResult = streamReader.ReadToEnd();//返回结果
streamReader.Close();
returnStream.Close();
return endResult;
}
}
}
微信小程序 代码示例:
wx.request({
url: 'http://openapiai.xueersi.com/v1/api/img/ocr/photo_search',
method: "post",
data:
{
app_key: "8102b22a5e81e840176d9f381ec6f837",
img: "https://ai.xueersi.com/textRecognition/images/22.jpg",
img_type: "URL",
time_stamp: "1551174536",
nonce_str: "W8FI8oCp",
sign: "c08d8f9900479a3b2a348c1d7dc7e918e71be66a"
},
header: {
"content-type": "application/x-www-form-urlencoded",
},
success(res) {
console.log(res.data)
}
})
iOS 代码示例:
NSURLSession *session = [NSURLSession sharedSession];
NSString *urlStr = @"http://openapiai.xueersi.com/v1/api/img/ocr/photo_search";
NSURL *url = [NSURL URLWithString:urlStr];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
request.HTTPMethod = @"POST";
NSString *app_key = @"app_key=8102b22a5e81e840176d9f381ec6f837";
NSString *img = @"img=https://ai.xueersi.com/textRecognition/images/22.jpg";
NSString *img_type = @"img_type=URL";
NSString *time_stamp = @"time_stamp=1551174536";
NSString *nonce_str = @"nonce_str=W8FI8oCp";
NSString *sign = @"sign=c08d8f9900479a3b2a348c1d7dc7e918e71be66a";
NSString *paramsStr = [NSString stringWithFormat:@"%@&%@&%@&%@&%@&%@", app_key, img, img_type, time_stamp, nonce_str, sign];
request.HTTPBody = [paramsStr dataUsingEncoding:NSUTF8StringEncoding];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
NSLog(@"result=%@",dict);
}];
[dataTask resume];
返回响应
返回格式
JSON格式
响应参数说明
参数名
类型
赋值说明
样例
备注
code
string
返回码
0
msg
string
返回码解释
"请求成功"
data
object
识别数据结构
数据结构
id
string
试题id
试题id
parent_id
int
父级id,父级不为0则为改编类型试题
父级id,父级不为0则为改编类型试题
answer
string
试题原始答案,不做任何业务使用
试题原始答案,不做任何业务使用
answer2
string
试题答案2,此答案用于用户作答验证使用,(填空题去除答案分隔符[|||]及latex标示符$$符后答案)
试题答案2,此答案用于用户作答验证使用,(填空题去除答案分隔符[|||]及latex标示符$$符后答案)
answer3
string
试题答案3,此答案用户页面渲染展示使用(此答案去除答案分隔符[|||],保留latex标示符$$)
stem
string
试题题干
type
string
试题类别(1 填空 2选择 3解答 4语音测评)
analytic
string
试题解析
"试题解析内容"
categoryId
string
试题题型id
choice_type
int
选择题类型 1单选题 2多选题
material_id
string
试题材料id
material_audio
string
试题材料音频
is_objective
string
是否为客观题 1 是 2否
material_content
string
材料内容
audio.content
string array
试题音频链接结合,如果不存在,则为空数组
audio.stem
string array
试题题干音频文件
audio.analytic
string array
题解析音频文件
serial_num
string
试题在材料题下序号
option
object array
试题选项,选择题使用此字段,其他类型试题不使用此字段
knowledge
object
试题知识点信息
option_num
int
选择题为正确答案个数,填空题为空个数
programming_url
object
编程试题url,只有试题题型为3解答题的时候才存在此字段信息
programming_url.stem
string array
programming_url.analytic
string array
响应代码示例
响应Body:
{
"code": 0,
"msg": "请求成功",
"data": {
"data": {
"list": [{
"analytic": "解:根据题意,三角形的两角和它们的夹边是完整的,所以可以利用“角边角”定理作出完全一样的三角形.\u003cbr\u003e\n故选D.",
"answer": "D",
"answer2": ["D"],
"answer3": ["D"],
"audio": [],
"categoryId": "51",
"choice_type": "1",
"department": "2",
"display_type": "0",
"id": "113892",
"is_objective": "1",
"knowledge": {
"7961": {
"alias_name": "",
"id": "7961",
"name": "ASA"
}
},
"material_audio": [],
"material_content": "",
"material_id": 0,
"material_topic_answer": [],
"option": [{
"content": "$$\\text{SSS}$$",
"is_right": "0",
"label": "A"
}, {
"content": "$$\\text{SAS}$$",
"is_right": "0",
"label": "B"
}, {
"content": "$$\\text{AAS}$$",
"is_right": "0",
"label": "C"
}, {
"content": "$$\\text{ASA}$$",
"is_right": "1",
"label": "D"
}],
"option_num": 4,
"parent_id": 0,
"programming_url": [],
"serial_num": 0,
"stem": "如图所示,亮亮书上的三角形被墨迹污染了一部分,很快他就根据所学知识画出一个与书上完全一样的三角形,那么这两个三角形完全一样的依据是( )\u003cbr\u003e\n\u003cimg src=\"https://hw.xesimg.com/test_library/img/2018/10/17/t_113892_54_104x93.png?1539772112\"\u003e",
"subject_id": "2",
"type": "2"
}, {
"analytic": "解:根据题意,三角形的两角和它们的夹边是完整的,所以可以利用“角边角”定理作出完全一样的三角形.\u003cbr\u003e\n故选A. \u003cbr\u003e\n考点:全等三角形的应用\n\n",
"answer": "A",
"answer2": ["A"],
"answer3": ["A"],
"audio": [],
"categoryId": "51",
"choice_type": "1",
"department": "2",
"display_type": "0",
"id": "447944",
"is_objective": "1",
"knowledge": {
"7961": {
"alias_name": "",
"id": "7961",
"name": "ASA"
}
},
"material_audio": [],
"material_content": "",
"material_id": 0,
"material_topic_answer": [],
"option": [{
"content": "$$ASA$$ ",
"is_right": "1",
"label": "A"
}, {
"content": "$$SAS $$ ",
"is_right": "0",
"label": "B"
}, {
"content": "$$AAS$$",
"is_right": "0",
"label": "C"
}, {
"content": "$$SSS $$ ",
"is_right": "0",
"label": "D"
}],
"option_num": 4,
"parent_id": 0,
"programming_url": [],
"serial_num": 0,
"stem": "如图所示,小明试卷上的三角形被墨迹污染了一部分,很快他就根据所学知识画出一个与试卷原图完全一样的三角形,那么两个三角形完全一样的依据是( ) \u003cbr\u003e\n\u003cimg src=\"https://mr.xesimg.com/test_library/ordinaryimg/2016/05/14/t_447944_7_205x81.png\"\u003e",
"subject_id": "2",
"type": "2"
}, {
"analytic": "根据题意,三角形的两个角和它们的夹边是完整的,所以可以利用"角边角"定理作出完全一样的三角形. \u003cbr\u003e\n故选:C. \u003cbr\u003e\n考点:全等三角形的应用. ",
"answer": "C",
"answer2": ["C"],
"answer3": ["C"],
"audio": [],
"categoryId": "51",
"choice_type": "1",
"department": "2",
"display_type": "0",
"id": "446440",
"is_objective": "1",
"knowledge": {
"7961": {
"alias_name": "",
"id": "7961",
"name": "ASA"
}
},
"material_audio": [],
"material_content": "",
"material_id": 0,
"material_topic_answer": [],
"option": [{
"content": "$$SSS$$ ",
"is_right": "0",
"label": "A"
}, {
"content": "$$SAS$$ ",
"is_right": "0",
"label": "B"
}, {
"content": "$$ASA$$ ",
"is_right": "1",
"label": "C"
}, {
"content": "$$AAS$$ ",
"is_right": "0",
"label": "D"
}],
"option_num": 4,
"parent_id": 0,
"programming_url": [],
"serial_num": 0,
"stem": "如图,聪聪书上的三角形被墨迹污染了一部分,他根据所学知识很快就画了一个与书本上完全一样的三角形,那么聪聪画图的依据是( ) \u003cbr\u003e\n\u003cimg src=\"https://hw.xesimg.com/test_library/img/2017/12/09/t_446440_6-1_157x126.png?1512806402\"\u003e",
"subject_id": "2",
"type": "2"
}, {
"analytic": "解:小明书上的三角形被墨水污染了,他根据所学知识画出了完全一样的一个三角形,\u003cbr\u003e\n他根据的定理是:两角及其夹边分别相等的两个三角形全等$$\\left( \\text{ASA} \\right)$$.\u003cbr\u003e\n故答案为:D.\u003cbr\u003e",
"answer": "D",
"answer2": ["D"],
"answer3": ["D"],
"audio": [],
"categoryId": "51",
"choice_type": "1",
"department": "2",
"display_type": "0",
"id": "1139943",
"is_objective": "1",
"knowledge": {
"7961": {
"alias_name": "",
"id": "7961",
"name": "ASA"
}
},
"material_audio": [],
"material_content": "",
"material_id": 0,
"material_topic_answer": [],
"option": [{
"content": "$$\\text{SSS}$$",
"is_right": "0",
"label": "A"
}, {
"content": "$$\\text{SAS}$$",
"is_right": "0",
"label": "B"
}, {
"content": "$$\\text{AAS}$$",
"is_right": "0",
"label": "C"
}, {
"content": "$$\\text{ASA}$$",
"is_right": "1",
"label": "D"
}],
"option_num": 4,
"parent_id": 0,
"programming_url": [],
"serial_num": 0,
"stem": "如图所示,小明书上的三角形被墨水污染了,他根据所学知识画出了完全一样的一个三角形,他根据的定理是( )\u003cbr\u003e\n\u003cimg src=\"https://mr.xesimg.com/test_library/img/2018/08/03/t_1139943_2_302x220.png?1533275497\"\u003e",
"subject_id": "2",
"type": "2"
}, {
"analytic": "解:根据题意,三角形的两角和它们的夹边是完整的,所以可以利用“角边角”定理作出完全一样的三角形.\u003cbr\u003e\n故答案为:两角和它们的夹边分别相等的两个三角形全等.",
"answer": "[|||]两角和它们的夹边分别相等的两个三角形全等[|||]",
"answer2": ["两角和它们的夹边分别相等的两个三角形全等"],
"answer3": ["两角和它们的夹边分别相等的两个三角形全等"],
"answer4": [
["两角和它们的夹边分别相等的两个三角形全等"]
],
"audio": [],
"categoryId": "52",
"choice_type": 0,
"department": "2",
"display_type": "0",
"id": "1040364",
"is_objective": "0",
"knowledge": {
"7957": {
"alias_name": "",
"id": "7957",
"name": "全等形的性质"
},
"7961": {
"alias_name": "",
"id": "7961",
"name": "ASA"
}
},
"material_audio": [],
"material_content": "",
"material_id": 0,
"material_topic_answer": [],
"option": {
"1": {
"content": "两角和它们的夹边分别相等的两个三角形全等"
}
},
"option_num": 1,
"parent_id": 0,
"programming_url": [],
"serial_num": 0,
"stem": "如图所示,亮亮书上的三角形被墨迹污染了一部分,他根据所学的知识很快就画出了一个与书上完全一样的三角形,那么亮亮画图的依据是\u003cspan class='test_blank' style='width:192px'\u003e\u0026nbsp;\u003c/span\u003e.\u003cbr\u003e\n\u003cimg src=\"https://hw.xesimg.com/test_library/img/2018/08/03/t_1040364_bjsb4_189x119.png?1533290915\"\u003e",
"subject_id": "2",
"type": "1"
}],
"rows": 210494
},
"status": 100
}
}
常见问题及反馈
python拍照搜题_OCR拍照搜题相关推荐
- 用python的OCR实现自动拍照搜题--源码
自动拍照搜题源码 说明: 因为有很多人要源码,所以还是贴一下好了 很久之前的一个小demo就是搞着玩玩的没什么技术含量,马上要毕业去工作了,现在也不想在动了. 虽然是叫"自动拍照搜题&quo ...
- 大学python搜题软件_2020中国大学MOOC的APP慕课用Python玩转数据期末考试搜题公众号答案...
[多选] 学前教育的主要任务是(). [填空题] 3V化25Hz相敏轨道电路受端变压器采用电抗轨道变压器型号为:(). [单选] 0.1MPa,20℃时,10克食盐可完全溶解于100克水中,此温度压力 ...
- 九月十月百度人搜 阿里巴巴 腾讯华为笔试面试八十题 第331 410题
分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! 九月十月 ...
- 网课查题公众号-搜题接口使用
网课查题公众号-搜题接口使用 本平台优点: 多题库查题.独立后台.响应速度快.全网平台可查.功能最全! 1.想要给自己的公众号获得查题接口,只需要两步! 2.题库: 查题校园题库:查题校园题库后台(点 ...
- 今日推荐一款实用的搜题小程序,题多多搜题
为什么要用小程序 1.不用安装,即开即用,节省流量,节约安装时间,而且不占用桌面: 2.功能上更为集中.单一,降低用户的使用难度,减少手机的过度使用. 小程序怎么找 现在大厂都已经推出了各自的小程序, ...
- 中国地质大学(北京) 研究生 2022秋《Python科学计算》期末考试 模拟题2 题目+参考答案
另一套模拟题1: 期末考试 模拟题1 考试方法 浏览器(Chrome.火狐)登录PTA网址: pintia.cn,单击右上角"登录->考试登录",下拉菜单输入cugb 选择& ...
- 中国地质大学(北京) 研究生 2022秋《Python科学计算》期末考试 模拟题1 题目+参考答案
另一套模拟题2: 期末考试 模拟题2 考试方法 浏览器(Chrome.火狐)登录PTA网址: pintia.cn,单击右上角"登录->考试登录",下拉菜单输入cugb 选择& ...
- 用Python解“两个数的简单计算器”题
7-12 两个数的简单计算器 本题要求编写一个简单计算器程序,可根据输入的运算符,对2个整数进行加.减.乘.除或求余运算.题目保证输入和输出均不超过整型范围. 输入格式: 输入在一行中依次输入操作数1 ...
- python中的条件判断稀硫酸_大学mooc2020用Python玩转数据期末考试查题公众号答案...
大学mooc2020用Python玩转数据期末考试查题公众号答案 更多相关问题 下列表述或叙述中,正确的是().A.1 mol氢B.3 mol H2C.2 mol氢分子D.1 mol H 相同质量的钠 ...
- 电子学会 2020年6月 青少年软件编程Python编程等级考试一级真题解析(选择题+判断题+编程题)
青少年编程Python编程等级考试一级真题解析(选择题+判断题+编程题) 2020年6月 一.选择题(共25题,共50分) 以下哪种输入结果不可能得到以下反馈: 重要的事情说三遍:安全第一!安全第一! ...
最新文章
- linux iscsi 服务端,Linux的iscsi磁盘服务
- ssm中使用hibernate-validator验证BO
- 文件上传下载流程设计
- Chrome新的语言API,让您的浏览器说话
- SPSS的算法介绍与实现
- 中医教你5个补肾护发食疗方
- 小程序动态class_会后剧透!百度智能小程序的最新动态都在这儿了!
- winscp 自动断开无法连接_winscp教程,winscp教程,看完就学会的winscp教程
- 网址收藏 2020.12.11
- 私域经济运营能力最关键的三个指标
- s2结业项目营业网点查询_论文发表完成科研项目的材料
- MFC中让自定义的类能响应消息
- 所有快捷方式失效的解决方法
- 在Unity中模拟汽车的移动
- html5多重阴影怎么设置,使用CSS3 box-shadow属性实现按钮的多重阴影效果
- Excel 简单线性回归图表制作
- html文字超过部分显示为省略号
- error pulling image configuration:XXX net/http: TLS handshake timeout
- 拼多多商品id怎么查看 拼多多店铺ID怎样看
- flex布局控制每行显示几个且有间隔