How do I deploy my chatbot model on google assistant? - dialogflow-es

I have developed my chatbot in PyTorch framework for college purposes. The model is working fine with log loss value of 0.5 and is able to answer questions appropriately. I have seen few productionization suggestions like fast.ai, flask and Django. But I want the model to be deployed on Google Assistant so that my end users can utilize the service of bot without any external installations. How do I have to integrate my PyTorch model to the Google Assistant on Dialogflow ?

Google has published a series of Codelabs to help developers start building actions for the Google Assistant. Each module can be taken standalone or in a learning sequence with other modules.
In each module, the codelabs provide you with end-to-end instructions on how to build Actions from given software requirements and how to test your code. They also teach the necessary concepts and best practices for implementing Actions that give users high-quality conversational experiences.
You can start here.

Related

How to get response from the API (which is not in local) using webhook

An android app has been developed by my development team. For which a chatbot is to be developed. So I chose DialogFlow platform to create the chatbot. Here, the API's for the app screens has been created by the development team. For the chatbot in DialogFlow, after creating all the necessary intents, is it just enough to enter the API url in the webhook url section or do I need to apply any logic in inline editor. [Here, the API's are created using python and it is connected with MySql DB]
As a beginner to DialogFlow, I couldn't move forward. Can anyone please help me out. Thanks in advance.
If you made your intents for your chatbot you will still need to write code which chooses what to do for each intent. Dialogflow's documentation can explain you more about the details of what you need to do.
Below is an image of an overview of all components from the documentation. To connect your chatbot to your MySQL API you will have to write a webhook service. This service can be an API which you host somewhere or code that you write in Dialogflows inline editor. Here you can program what API's to call on each intent and how to output it to the user. More info about that can be found here.

Is it possible to use Googles WaveNet Text-To-Speech model for the Actions-On-Google integration of a Dialogflow agent?

Google Clouds Text-To-Speech API has a WaveNet model whose output in my opinion sounds way better than the standard speech. This model can be used in Dialogflow agents (Settings > Speech > Text To Speech), which results in the generated speech being included in the DetectIntentResponse. However, I can find no way to use this speech with the Actions-On-Google integration, i.e. in an actual Google Assistant app. Have I overlooked this, or is this really not possible, and if so, does anyone know when they plan to enable this?
In the Actions console, going to the Invocation page lets you select a TTS voice.
All of the voices can be demoed on the Languages & Locales page of the docs, and the vast majority of them use WaveNet voices.

Can I use PubNub instead of DirectLine with BotBuilder?

Building a productivity chatbot. Hosting it on Heroku. Since I want to have very minimal dependency on Azure, I want to avoid directline APIs. Is it possible to use PubNub instead? Any insights / examples would be very helpful.
Building a Chatbot
You can build a chatbot with PubNub instead of DirectLine with BotBuilder. The following shows you how to build a chatbot using serverless techniques. The example also includes voice recognition using Google's voice API. So it's just a step up from what you're asking. You can include or exclude the voice recognition technology used.
Walkthrough: https://www.pubnub.com/blog/build-an-80s-chatbot-with-an-npm-package/
Try it live: https://stephenlb.github.io/artificial/
GitHub: https://github.com/stephenlb/artificial

What is the difference between Dialogflow bot framework vs Rasa nlu bot framework?

What is the difference between Dialogflow bot framework vs Rasa nlu bot framework ?Any other open source frameworks available in market with NLP support?
I think I can answer this without any bias, granted that overtime the answer will grow outdated as the two services evolve.
Cliffnotes version:
Dialogflow is a complete closed source product with a fully functional API and graphical web interface. Rasa (NLU + Core) are open source python libraries that require slightly lower level development. Both try to abstract some of the difficulty of working with Machine Learning to build a chatbot.
As of writing this however here is my comparison:
DialogFlow
Is a mostly complete tool for the creation of a chatbot. Mostly complete meaning that it does almost everything you need for most chatbots.
Specifically it can handle classification of intents and entities. It uses what it calls context to handle dialogue. It allows web hooks for fulfillment.
One thing it does not have that is often desirable for chatbots is some form of end user management.
It has a robust API, which allows you to define entities/intents/etc either via the API or with their web based interface.
Formerly known as API.ai before being acquired by Google.
Data is hosted in the cloud and any interaction with API.ai require cloud related communications.
Cannot be operated on premise.
Rasa NLU + Core
To get close to the same level of fucntionality as Dialogflow you have to use both Rasa NLU and Rasa Core. Rasa NLU handles projects/intents/entities whereas Rasa Core handles dialogue and fulfillment.
Rasa doesn't provide a complete open source GUI leaving most of your interactions with NLU in JSON or markdown. And Rasa Core requires direct python development to customize your bot.
Also does not directly offer any sort of user info management.
The Rasa team does not provide hosting (at least outside of their enterprise offerings) and you will be responsible for hosting and thus ownership of the data.
Can be operated on premise.
As far as other open source frameworks, I would say that it is very likely that most chatbot frameworks right now are built on a variety of open source tools, with some proprietary add-ons. So you can always start from the lower level open source tools like MITIE or spaCy.
Update:
The Smart Platform Group (of which I am a member) recently released a product in between Rasa NLU/Core and Dialogflow called Articulate.
Articulate is a full-featured bot framework, based on Rasa NLU, that lets you build Natural Language Agents effortlessly.
Uses Rasa NLU for understanding and custom context based code for dialog. This makes it work closer to how Dialogflow does than Rasa Core.
HTTP API for creating intents, entities, and interacting with agents.
GUI similar to Dialogflow that is fully open source.
Data and interface can be hosted in the cloud or on premise.
Dialogflow:
No installation, get started immediately
Easy to use, non-techies can also build bots
Closed system
Web-based interface for building bots
Data is hosted on the cloud
Can’t be hosted on your servers or on-premise
Out of box integration with Google Assistant, Skype, Slack, Fb messenger, etc
Rasa:
Requires installation of multiple components
Requires tech knowledge
Open-source, code available in Github
No interface provided, write JSON or markdown files
No hosting provided (at least in the free version)
Host it on your server
No out of box integration
Source: https://www.kommunicate.io/blog/dialogflow-vs-rasa-which-one-to-choose/
The most important difference is, the entire NLU, NLP and NLG is not happening under the hood in case of Rasa. It's open source. You are the boss. In case of Dialogflow, you have all the functionalities but it has to send the data to cloud service every time a dialog transaction happens. Also some of the service providers have limits on number of dialogs per day.
However Dialogflow is flawless, simple to use and easy to model.
Microsoft's bot framework is also open source
https://github.com/microsoft/botframework-sdk
For nlp it is typically paired with LUIS, and LUIS is not open source.
SpaCy however is an open source nlp (the one that RASA uses also). It would be a completely valid workflow to create a IReconizer in bot framework to use SpaCy https://spacy.io/
There are a hand full of chat engines that also use SpaCy open source NLP that are linked on their site here https://spacy.io/universe/category/conversational.

how to write own logic without using qnamaker

I am still trying to understand Chatbots. Currently i have already made chatbot which is integrated in skype. I have Sharepoint online where user search for FAQ. If they dont find then they ask BOT which sends request to LUIS and Qnamaker.
Qnamaker then sends response back by looking it into its database. I upload FAQ from sharepoint to Qnamaker using sharepoint workflows. But i want to write my own logic and get rid of Qnamaker.
What are ways to do it? Any good tutorials? I also wanted to know how the flow happens. For example if we dont use Qnamaker then we fire queries in sharepoint based on what user asked? I dont understand how i can fire queries in sharepoint if user makes typo then we will not get anything from sharepoint. So any tips on how to implement this without using qnamaker is highly appreciated?
The FAQ bot generator is a subset of the main Microsoft bot framework. You should do some research on the Microsoft Bot Framework. The link above takes you right to the documentation overview of the bot framework and from there you can get into developing one. They have links to a few sample projects as well as a large number of code snippets within some of the article explanations. It has a full setup guide that will walk you through the initial setup so it should be easy to get a basic echo bot running, but if you are not a programmer you should stick to the FAQ generator.
I suggest you use either node.js or c# to develop the bot since these are directly supported by the framework. I am personally using c# to build my bot from the ground up. The purpose of mine is to be used within a customer facing android/ios app that will help with questions, checking the status of different things, and even paying bills.
Just remember you will need to manually set up your cloud hosting. I host mine in azure alongside a web interface I built for it (you can build the website inside your bot if you are using c#, just replace the default.htm file in the web.config with the main page of the interface).

Resources