Turing human platform, based on natural language processing, knowledge base and cloud computing technology, for the vast number of developers, partners to provide a range of intelligent semantic processing capabilities (including semantic understanding, intelligent answer, knowledge base docking, etc.) service platform. Until now, the platform has accumulated nearly Bai corpus and PB level of basic data, the overall accuracy of the test platform has reached more than 90%, and the platform has been applied to HTC's small hi voice assistant, China Telecom's micro-letter platform, Haier's intelligent home appliances control system, widely praised by enterprises.
Below is a description of his API:
Here is an excerpt from the official website: http://www.tuling123.com/openapi/cloud/api.jsp?section=9
$apiKey = "own Appkey";
$apiURL = "Http://www.tuling123.com/openapi/api?key=KEY&info=INFO";
Set up the message header and construct the request message
Header ("content-type:text/html; Charset=utf-8 ");
$reqInfo = "Tell a joke";
$url = Str_replace ("INFO", $reqInfo, Str_replace ("KEY", $apiKey, $apiURL));
/** method, using file_get_contents to get content
$res =file_get_contents ($url);
Echo $res;
/** Method II, the use of Curl Library, you need to see if the php.ini has been opened Curl extension */
$ch = Curl_init ();
$timeout = 5; curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_connecttimeout, $timeout);
$file _contents = curl_exec ($ch);
Curl_close ($ch);
echo $file _contents;
return Result:
This is a JSON string, and we just use PHP's JSON to process the string.
Returns the result using Json_decode () to return the JSON data $data, which can be used to output jokes by $data->text.
Similarly, we can $reqinfo this variable to allow users to input, you can make their own interface of the robot.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service