Sometimes we need not just a number of links but a particular answer to our request. The Google company is very advanced in this respect.
Ok Google and a built-in assistant in the Google Allo messenger allow to find answers to many questions, though not to all. In this connection, Endurance starts developing its own bot on the basis of the Google API. Besides the Google API, we use other solutions as well to evaluate the correctness of the response.
What is the Google Web Search API?
REST, or Representational State Transfer, in the JSON/Atom Custom Search API is somewhat different from traditional REST. Instead of providing access to resources, the API provides access to a service. As a result, the API provides a single URI that acts as the service endpoint.
You can retrieve results for a particular search by sending an HTTP GET request to its URI. You pass in the details of the search request as query parameters. The format for the JSON/Atom Custom Search API URI is: https://www.googleapis.com/customsearch/v1?parameters
Three query parameters are required with each search request:
- API key– Use the key query parameter to identify your application.
- Custom search engine ID– Use either cx or cref to specify the custom search engine you want to use to perform this search.
- Search query– Use the q query parameter to specify your search expression.
For more details you may visit: https://developers.google.com/custom-search/json-api/v1/using_rest
The problem to be solved
The existing problem: Google does not always give exact answers. It can give a number of links with possible answers instead of a correct answer.
Our goal is: to make a convenient and efficient chatbot that will give real answers, not links.
Why is it important?
To search for something its is necessary to use Google search or a web browser. Our solution works in any communicator: Messenger, Twitter, Slack, Gmail, Telegram + web interface.
It makes the search easier and provides a better access to the information you need. A user gets not just a number of links but a particular answer to a particular question. Our chatbot looks for answers using Google API, then chooses and gives a more relevant answer. Besides, our chatbot parses the link given by Google and answers on the basis of what it has found in the given link.
What is the advantage of our chatbot?
- Our chatbot looks for answers but not for links with probable answers.
- The chatbot is able to use analogies for the search for answers to questions
- It can read and analyze texts by way of parsing than is, it can give a full answer to a question.
- It works in any messenger with the open API.
- It learns, analyzing the search results (if the user gets a relevant answer to the question).
What is an additional ability of the chatbot?
One can specify and add details to the query.
You write on Google: «What is the weather like today in Moscow?»;
Google gives an answer.
If you write after that “And in San Francisco?”, Google will be unable to answer, because your new question lacks the phrase “what is the weather like”. Google does not remember the context.
The Endurance chatbot does remember the context and understands that you are referring to the weather, so it can answer your question “and in San Francisco?” Holding the context is the main advantage of the chatbot’s smart search.
Plans to customize the chatbot
We plan to implement the following options: “continue the search”, “specify”, “give more details”, “point out what is more important”, “learn”, “continue as the text goes”.
The basic concept of the smart search is that the search bot can also use not only a direct request, but also “analogies and synonymic row,” i.e, the chatbot analyzes and searches for meaning.
The search is done not only by keywords, but also by synonyms.
For example, the search text lacks the keywords necessary for the answer. To enable the chatbot to give an answer in the absence of the desired keyword, we plan to add the method of analogies; that is, our search bot will be able to find the necessary answer, using analogies, even if the text lacks the required keyword.
What is to be done on the project
The Endurance project plans to improve the quality of answers by way of offering to the users a more convenient channel of the information search and gaining.
You can test our bot on Telegram: https://web.telegram.org/#/[email protected]_searchbot
On our website: https://old.endurancerobots.com/endurance-poiskovyj-bot/
Send your feedback to [email protected]
Written by George Fomitchev, Founder of Endurance