Implementation of personal chatbots-Turing robots and chatbots

Source: Internet
Author: User

Implementation of personal chatbots-Turing robots and chatbots

First experience: Turing robot intelligent chat experience: http://www.tuling123.com/openapi/cloud/proexp.jsp


1. Introduction

This article introduces how to use the Turing robot api to implement chatbots. This api already has the smart chat function, however, we can customize the knowledge base to easily implement dedicated personal chatbots.

2. Development steps

The following uses java Development as an example to compile a simple Web Chat Robot. The main development process is as follows:

1. Compile a simple jsp page (used to interact with the background of your project, submit the request content, and receive and display the processing result)

HTML code

<Body> <textarea rows = "5" cols = "" placeholder = "Enter the content" name = "info" id = "info"> </textarea> <br> <input type = "button" onclick = "doSubmit () "value =" Submit "> <br> <label id =" res "> </label> </body>


JS Code

<Script type = "text/javascript"> function doSubmit () {var info = $ ('# info '). val () var url = 'background interface of your project (such as servlet) '; $. get (url, {info: info, key: register a Turing robot account to obtain key}, function (json) {if (json! = Null) {alert (json); document. getElementById ("res "). innerText = json;} else {document. getElementById ("res "). innerText = 'no returned value ';}}) ;}</script>

2. The project background receives page request content, calls the Turing api, and returns the processing result (core logic code)

JAVA background server code (send httpget request, request Turing robot)

/** Call the Turing robot platform interface * package to be imported: commons-logging-1.0.4.jar, httpclient-4.3.1.jar, httpcore-4.3.jar */public void getTulingApi () {String INFO = URLEncoder. encode ("weather in Beijing today", "UTF-8"); String requesturl = "http://www.tuling123.com/openapi/api? Key = register the keykey & info = "+ INFO; HttpGet request = new HttpGet (requesturl); HttpResponse response = httpclients.createdefault(.exe cute (request ); // 200 is the correct response code if (response. getStatusLine (). getStatusCode () == 200) {String result = EntityUtils. toString (response. getEntity (); System. out. println ("returned result:" + result );}}

3. At this point, this simple Web Chat Robot has been developed, but all the chat reply content is the knowledge base of the Turing robot api. You only need to log on to its official website, you can use the knowledge base page to import your own questions and answers in batches, so that the robot can answer the defined content and realize the exclusive personal chatbot.

Turing robot intelligent chat experience: http://www.tuling123.com/openapi/cloud/proexp.jsp












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.

How to create high-end chatbot Algorithms

The landlord is really interesting. The owner can know the Turing test. It's a test of Turing's vision. If a person chats on a terminal and a computer can cheat a real person, he thinks he is chatting with a real person. This is even if the Turing test is passed. So far, there is no such computer, as far as I know. Do you want to invent one?

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.