How to train api.ai/dialogflow chatbot dynamically? - dialogflow-es

I am trying to generate some "quick reply templates" i.e possible reply according to previous messages in a chat thread using Api.ai/Dialogflow.
I have trained api.ai agent to some extent to generate replies only for some selected queries. Now, I want to enhance it to generate replies for more queries but training an agent manually for a large number of queries is not practically possible. Is there any way to train the api.ai chatbot dynamically by analysing the previous chat thread, i already have stored in db or using the data of ongoing chats.
Users are some sellers so i assume they will talk regarding there product only, so questions will be somewhat similar in every chat thread.

Looks like there is now the ability to train via the API: https://dialogflow.com/docs/training, along with uploading text files with training lists.
You can add more Training Phrases using the POST and PUT API methods for the /intents endpoint.
Any changes made via the API to alter the agent's behavior, initiate the training in the same way when you save an intent. This trains the agent with the changes delievered through the API.

There currently isn't a API for training.
If you have a log of the queries for your agent (via the API or your webhook), you could "train" your agent by using those log to determine the most common unanswered queries by looking at how many queries match the default fallback intent and create new intents and responses for those queries using Dialogflow's API: https://dialogflow.com/docs/reference/agent/intents#post_intents

Related

Is there a way to program intent and is it possible to call different models on different steps in DialogFlow?

I'm currently working on building a chatbot and I saw the Dialogflow tool that can provides a lot of help in this topic, so my question if it's usable to have multiple contexts at once and also to be able to call my NLP model (stored in an API) many times? Or do I have to build my own platform for that since Dialogflow can't be call multiple webhooks at once?
Example:
I have a model to classify the initial intent,
I have a regression model to do something else if the intent is XXX.
First, remember that an Intent represents what the user says or does and not how you react to that.
Within that, yes, it is perfectly feasible to have multiple Contexts active at once. The lifespan of a Context determines how many rounds of the conversation it will be active for. All of the Input Contexts for an Intent must be active for that Intent to be considered for matching.
While Dialogflow only lets you register one webhook for all of the Intents, it provides information to that webhook about which Intent was triggered (along with which Contexts are active, parameter values, etc). Based on that, or any other information you wish, you can choose which code or handler to execute. In this way, you can certainly make multiple calls to other APIs if that makes sense - as long as you return within the timeout period (5-7 seconds).

WebHook update for Google Fit Activity

I would like to get user Google Fit activity updates to my server (via webhook) so there is no need to make request periodically.
Currently i have a cron job to get data, but has two problems, infrastructure complexity and delay from the data generation and data processing.
I have seen that there is a Google Report Api but does not support Google Fit.
https://developers.google.com/admin-sdk/reports/v1/guides/push

Agent Training in DialogFlow

I have written and submitted an app via DialogFlow for Google Home which is now live. If I make use of the training facility in DialogFlow (https://dialogflow.com/docs/training-analytics/training) and match un-matched user questions to existing intents, do I need to resubmit my app to google for the training to take effect? Unfortunately the documentation is not clear on this point.
I contacted DialogFlow re the question and they confirmed that that app does need to be resubmitted to google if you use their training function as this alters the language model.

How to clear the session between two consecutive intents?

We are using bot trees master which uses bot graph dialog for loading graph based dialogs dynamically. We have created a scenario to load multiple intents(whose intents scores are nearly matching). Now the problem I am facing is when I request for single intent , I am getting the bot response and able to enter into next intent but when I request for multiple intents bot is giving the response and when I request for another intent , bot is giving the same response of multiple intents. When bot is entering into multiple intent handler it is not clearing the session and not coming out of that handler. I have tried using session.endConversation().
To understand about bot graph dialog:
https://www.microsoft.com/developerblog/2016/11/11/extending-microsofts-bot-framework-with-graph-baseddialogs-/
Can somebody help on this. Thank you
the builder.IntentDialog() used in this project is no longer considered a best practice. Additionally, further support is not expected. Instead, you will want to use bot.Dialog() to create your dialog flows with a .triggerAction(). The trigger matches on phrases which you can set a score to. Unfortunately, it means you will need to recreate the bot-trees project to fit this new model.
You can find information on managing conversations here, including creating triggers.
If you need a more robust system, you can integrate LUIS into your project. Information regarding recognizing intents with LUIS can be found here.

Manual Action necessary for the API to return Entities ?

I am using Dialogflow’s API to feed intents and their respective entities. We’re doing this as a team so modifications are made on a pretty regular basis.
In the meantime, we select some utterances for which we know the desired classification, and we check via Dialogflow’s API (the /query endpoint) that the actual result meets the expectations.
For intents, the results are great. We always get an intent back from the API, and all is well.
As far as entities are concerned however, we have a peculiar behavior :
when we update the training (we add utterances, intents and entities) via the API without any manual action on the DialogFlow console, we don’t get any entities in the JSON response to /query
when we do the same thing, but we manually click on the « Save » button of all the intents,** we get entities in the JSON response** after the « Agent Started Training » flash message disappears.
Does this mean that there is always at least one manual action required for the training to actually be fully done and for entities to be returned in JSON response to the /query endpoint ? Is there a way for us to launch that training via API and prevent the manual save of the 100+ intents we have for our Agent ?
Thanks for any help you can provide !
Best regards

Resources