Christin
Christin

Reputation: 46

Is there anyway to convert or import AIML files to Dialogflow or Lex?

Is there anyway to convert or import AIML files to Dialogflow or Lex for creating a chatbot? I am hoping for a way to incorporate open source AIML files into an NLP chatbot framework like Dialogflow or Lex, and so far my googling has produced no avail.

I found a way to create a Dialogflow bot using CSV, and I wonder if this is a case of converting AIML into CSV? Is it feasible or a fool's errand?

Much appreciation for your advice, guidance, and brainstorming!

Upvotes: 3

Views: 839

Answers (2)

Sage
Sage

Reputation: 303

Keith Sterling has a way listed on his github page using python 3. It also has a full step-by-step implementation with screenshots and was just updated a few days ago. It’s AIML 2.1 compliant as well.

Also, it is completely free. DialogFlow itself has both free and paid tiers (as you may know) but his program is open source.

Here’s the link:Program-Y github Repo

By way of background, this is an AIML Interpreter (which is to say it is a way for you to deploy your AIML files under various circumstances). So while the link in the OP is more direct, this gives you more options.

For example this allows you to use your same files in:

  • Google Assistant
  • A Web Client
  • Messenger
  • Telegram
  • Alexa
  • Cortana
  • DialogFlow
  • etc

And because this is REST you only interact with your main implementation and this in-turn updates all client bots.

This helps you keep an updated central set of AIML files and is also lower on overhead.

Set-up:

First sign in and then click Create Agent.

Give you bot a name, and ensure the language and timezone is what you need them to be, and then click:

Create Intents

First, delete the 2 existing intents:

  • Default Fallback
  • Default Welcome

Next, create the intents for integration with Program-y (the name of the Repo).

There are 4:

  • Launch
  • Quit
  • Help
  • Query

Launch Intent

  • Click Create Intent
  • Enter your training phrases
  • select event, and then,
  • under fulfillment, choose web-hook

Quit Intent

Carry out the same steps as above, this time naming it Quit, but this time do not select an Event and use the following phrases:

  • stop
  • exit
  • leave
  • quit

Help Intent

Again carry out the same steps as above, this time naming it Help. Again do not select an Event and use the following phrases:

  • help
  • what can I ask you
  • help me
  • what can you do

Query Intent

Finally carry out the same processes, but this time name it Query. Again do not select an Event, but this time we have one training phrase

  • query

This time, however, add a parameter as follows:

Connect Endpoint

Finally we need to set the endpoint that DialogFlow will call each time it identifies an intent.

On the left hand side menu bar, click Fulfillment link. Click Enabled and then enter the URL that should be called which Program-Y is running on as a Google client.

The API endpoint is always /api/alexa/v1.0/ask So combine this with the ngrok URL, gives you https://87e27269.ngrok.io/api/alexa/v1.0/ask

To save this click 'Save Endpoints' and you are ready to get your client up and running.

Scroll down to the bottom and click Save.

I know that’s a lot of info and it may look overwhelming however there are screenshots and a walkthrough at the link: Program-Y github Repo

Upvotes: 1

Tlaquetzal
Tlaquetzal

Reputation: 2850

No, currently there is no way to do this. There is no straightforward way to translate AIML files to Dialogflow or Lex JSON import formats. The basic structure of how the conversation is handled is different. Although you can find the idea of Intent, Entities and Context in AIML (specially v2.0) you would need to do a lot of manual effort to adapt it.

I would recommend extracting the patterns -what the user says- and the templates -what the chatbot responds- from AIML, import it to the framework you want to use and adapt manually the context and entities.

Upvotes: 0

Related Questions