Code Monkey home page Code Monkey logo

bulk-intent-upload's Introduction

Bulk intent upload to DialogFlow:

Simple bulk intent upload in Dialogflow - google's chatbot creation platform

Note: I'm using acronym upload as an example- you can extend this functionality to whatever!

Some file information:

  • intentUpload.py is the shitty version, wherein I used selenium webdriver to automate the clicking and entering of text directly into the Dialogflow console, to create new intent.This is very slow and painful and not recommended . It's just here for future me to refer back, if I need to.
  • intentUpload_V2.py is the better one. The steps to execute it are given below, with an example.

The bulk intent upload

Export the current agent as a .zip file.

Extract it, and observe the intents folder. Each intent has two .json files associated with it: {intentName}.json and {intentName}_usersays_en.json. We aim to reproduce these using fake.json and fake_usersays_en.json as templates.

Refer to the image below:

export and import screen

Run intentUpload_V2.py

make sure you have the acronyms folder created in the same directory (tho this can be easily also done in python). This uses fake.json and fake_usersays_en.json as templates to generate two files for each intent.

Upload all the .json files generated into the intents folder (in the extracted .zip of the agent)

Zip the folder containing the intents folder, and select the Import from zip option in the dialogflow console

This is under "export and import" in settings of the agent. Since there are no ID's for what we uploaded, they will be generated automatically by Dialogflow.

..and this is what the result is!

the dialogflow console after bulk upload

There's many ways you can thus make mass changes to intent and entity structure through there files... this was just a simple use case. Have fun with your chatbot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.