Introduce Turing robot php API and robot phpapi
Based on natural language processing, knowledge base, and cloud computing technologies, the Turing robot platform provides developers and partners with a series of intelligent semantic processing capabilities (including semantic understanding, intelligent Q & A, and knowledge base interconnection) service platform. Up to now, the platform has accumulated nearly 10 billion pieces of corpus and PB-level basic data. The overall accuracy of the tested platform has reached more than 90%, moreover, the platform has been applied to HTC's Little Hi voice assistant, China Telecom's platform, Haier's smart home appliance control system, and so on, which is widely praised by enterprises.
The following describes his APIs:
Here from the official website: http://www.tuling123.com/openapi/cloud/api.jsp? Section = 9
$ ApiKey = "Your appKey ";
$ ApiURL = "http://www.tuling123.com/openapi/api? Key = KEY & info = INFO ";
// Set the packet header to construct the Request Message
Header ("Content-type: text/html; charset = UTF-8 ");
$ ReqInfo = "joke ";
$ Url = str_replace ("INFO", $ reqInfo, str_replace ("KEY", $ apiKey, $ apiURL ));
/** Method 1: Use file_get_contents to get content */
$ Res = file_get_contents ($ url );
Echo $ res;
/** Method 2: To use the curl library, check whether php. ini has enabled the 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;
Returned results:
This is a json string. You only need to use php json to process the string.
Use json_decode () to return json data $ data. In this way, you can use $ data-> text to output jokes.
Similarly, we can use the $ reqInfo variable to allow users to input and create robots on their own interfaces.
What is the Turing robot?
The Turing robot platform is a free open API platform based on natural language processing, knowledge base, and cloud computing technologies, A series of intelligent semantic processing capabilities (including semantic understanding, intelligent Q & A, and knowledge base interconnection) service platforms provided by developers and partners.
The Turing robot platform can be used in smart phones, Smart TVs, smart cars, smart mobile terminals, website customer service, and other fields to achieve intelligent interaction of natural languages.
At the same time, the Turing robot platform can access the public platform with one click to implement intelligent chat robots, intelligent customer service robots, and other services.
Which of the following is better for Tuling robots and I robots?
I personally think that the Turing robot is good. Compared with the small I, the Turing robot has no limit on the number of times of use. The upgrade from registration to API permission is much more convenient than the small I robot. In addition, according to the corresponding speed and feedback, the Turing robot is also higher than the small I robot.