Training dialogflow using large datasets

Viewed 4363

I have dataset having user queries and and responses. The dataset size is around ~50k. The data is stored in csv file having two columns for query and response respectively. How to train dialogflow using this dataset? Can I train it using python api? Its mentioned in their docs- https://dialogflow.com/docs/training-analytics/training . But I am unable to figure out how to train it? I want to train like this- https://miningbusinessdata.com/reader-question-automating-dialogflow-training/. But I am not able to fully understand how to do that.

1 Answers

You can just upload a TXT file containing a list of user queries for training. The process is described here. An alternative is to use the REST interface to update intents and add the training data as sample invocations via batchUpdate or use export/import to add your training phrases (I haven't tried this option).

  1. for TXT Upload: You can't upload the response, the response will be automatically determined with the current training.

    • Upload txt file with one line each for each user request (no other markup and no responses)
    • Switch to the "Training" menu and click on the uploaded conversation, you will see a list of user requests
    • Check if the user requests are matched with the correct response, if not, correct it
    • There's a button at the top to accept the result and the agent will train based on this new data
  2. For batch upload or export/import The function you mention for train is just a function to kick off training, not to add training data. You can however use the bach upload to add intents including sample invocations.

    • This is the HTTP request format POST https://dialogflow.googleapis.com/v2/{parent=projects/*/agent}/intents:batchUpdate
    • Give the batch as either URI or inline. You should be able to use updateMask to just update the training phrases
    • The documentation has more details but if you use inline, you send an intentBatch which contains a list of intents and each intent looks like this
    • You could also first export your project, add the training phrases in an automated script and then import the project again using projects.agent.import (see more here)
Related