Skip to content

kobkrit/dataframe-to-dialogflow-intent

 
 

Repository files navigation

dataframe-to-dialogflow-intent

csv-to-dialogflow-intent helps create intents in Dialogflow by uploading csv or excel file.

Quickstart

  1. Create a bot in Dialogflow and select a Google Cloud Project for your bot
  2. Enable Dialogflow API for your Google Project
  3. Enable billing for your project
  4. Create a service account for your project in your GCP console
  5. Set up authentication in your terminal
$ gcloud auth activate-service-account --key-file=KEY_FILE
  • KEY_FILE path to the private key file (JSON file obtained from creating a service account key)
  1. Set up your configuration in config.py
config = {
    'project_id':   '<YOUR DIALOGFLOW PROJECT ID>',
    'env':  '<YOUR KEY FILE>',
    'filename': '<YOUR FILENAME.xlsx>',
    'sheetname':    '<SHEET NAME>',
    'platform_default_custom_payload': 'line'
}
  1. Run main function to create intents in dialogflow
df = pd.read_excel(config['filename'])
ib = IntentBuilder(project_id, session_id)
ib.create_intents(df)

Sample excel file description

  • root_intent Root intent in the chain of followup intents
  • parent_intent Intent preceding each followup intents
  • intent_name The name of each intent
  • training_phrases Training phrases in dialogflow for the intent. Each cell represents a single user expression
  • response_type Facebook: text, quick reply, card, image, payload Line: text, payload
  • response Text response variations are separated by comma in the same cell Different block of text responses are filled in different cells Facebook payload format can be found in the documentation Line custom payload documentation
  • platform facebook, default (use 'default' for line platform)
  • fallback TRUE if the intent is fallback intent, otherwise FALSE

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.4%
  • Dockerfile 1.6%