AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

AIML to CSV
 
 
  [ # 16 ]

I’ll do one better. Here’s the link to the AIML file on my server:

http://geekcavecreations.com/CBO/badanswer.aiml

Looking at the page you’ve linked to, it wouldn’t be difficult to work backwards and convert the CSV file back to AIML. Given the information provided in that page I could write a script in PHP to perform the conversion in either direction with no difficulty. I don’t have tim e to do so at the moment, but I may consider doing so at some future point. smile

 

 
  [ # 17 ]

by the way, I found what appears to be another bug, in that “matrixed” indices, such as <that index=“2,1”> or <that index=“1,*”> are not converted into the #comma placeholder, which is causing the AIML to “overflow” into adjacent cells. In the file I’ve provided, you’ll see the problem on line 10 (once the newline problem is taken care of, that is).

It might also be a good idea to strip out any extraneous whitespace (e.g. tab characters, instances of two or more space characters in a row, etc.) from the template field. Just as in HTML, whitespace in AIML files is ignored, according to the AIML 1.0 specification, so removing it shouldn’t pose any problem.

 

 
  [ # 18 ]

I think I’ve fixed that bug.
https://1drv.ms/u/s!AqXLj61wk9JFg-hdO7KfQbM1x7z18Q

Even I was thinking about writing a csv to aiml script.

 

 
  [ # 19 ]

AIMLIF (AIML Intermediate Format) is a hybrid of CSV and XML. It is what I developed for fast loading and editing of AIML files for Program AB, and also for making the files more compact for mobile apps.

Especially nowadays with the widespread adoption of competing formats like YAML and JSON, people complain about the reliance of AIML on the somewhat antiquated XML format.  The biggest problem with XML for AIML is the repetitive nature of the <category>, <pattern>, <template> (and<topic> and <that>) tags, which tend to take up a lot of space in the files and make them hard to read. 

But inside the <template>, we actually want the recursive, hierarchical structure provided by XML.  It is what allows the template to become a “mini computer program” to calculate the bot response. Compared with JSON or YAML, it is more readable and less error-prone because you don’t need double-quote around every string.  This property of XML, that every statement is an implicit print statement—no quote marks required—always appealed to me.

You can use tools like Excel to edit the AIMLIF files, sort the categories by pattern, and fill in the blank templates for faster content creation. 

Since AIMLIF is basically the same as AIML without the <category>, <pattern>, <template>, <topic> and <that>, it’s not a heavy lift to automatically translate back and forth to pure AIML.

 

 
  [ # 20 ]

Aiml is indeed a very easy way to create a chatbot, I cannot imagine the amount of work it would involve making a chatbot using any conventional language.
We are all very thankful to you for providing us the easy way.

It is really easy to convert aiml and csv back and forth but not many people have tried to do it and feel that writing the same thing twice is a time consuming and boring. That’s why I tried making this parser so that people can increase their development speed.

 

 
  [ # 21 ]
Ravi Kumar - Feb 26, 2017:

I think I’ve fixed that bug.
https://1drv.ms/u/s!AqXLj61wk9JFg-hdO7KfQbM1x7z18Q

Even I was thinking about writing a csv to aiml script.

The link is not available. Can you provide the link to your app for converting aiml to csv?

 

 
  [ # 22 ]

Kavipria, the reason why that link is not available is because our beloved forum software has a problem with parsing the URL for that link, and removes an exclamation point from it. If you look at what the URL in Ravi’s post, then look at the actual URL it’s pointing to, you can see the problem. There was a similar problem on page 1 of this thread that I had the time to swap out for a bitly link. I don’t have time to do so this time, but the fix is simple. Just open the link in a new tab, then insert an exclamation point between the first and second characters (a lowercase ‘s’ and an uppercase ‘A’) after the last slash and the edited URL should work for you.

 

 
  [ # 23 ]

Thank you so much Dave. It works perfectly well. It is very helpful.

 

 
  [ # 24 ]
Dave Morton - Apr 5, 2017:

Kavipria, the reason why that link is not available is because our beloved forum software has a problem with parsing the URL for that link, and removes an exclamation point from it. If you look at what the URL in Ravi’s post, then look at the actual URL it’s pointing to, you can see the problem. There was a similar problem on page 1 of this thread that I had the time to swap out for a bitly link. I don’t have time to do so this time, but the fix is simple. Just open the link in a new tab, then insert an exclamation point between the first and second characters (a lowercase ‘s’ and an uppercase ‘A’) after the last slash and the edited URL should work for you.

[ul]
[li]that link no longer works, and i badly need an aiml to csv converter.[/li]
[li]Please i really need your help sir, doesnt program AB have an inbuilt aiml to csv converter? if it does sir, how can i use it?[/li][/ul]

You see the problem i have is that, i dont have aimlif files on my copy of program-ab from github. so whenever i try to run the program it throws exceptions that it cant find the aimlif files so the program simply loads all the aiml files everytime.

Also, i used this project https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwi5heHW_ZXVAhUJkRQKHdS4AOkQFggoMAA&url=https://github.com/mpegman/Py3kAiml&usg=AFQjCNHFNFfcZdXNoi82QENg6rpOGaTHCw

and in the program, when the bot loads all its aiml for first use, it saves it in a really nice binary format inside a file. so next time i run the program, the startup time reduces by over 60%! i don’t know if program ab has this kinda functionality. I happen to know java quite well, but i know very little about program-ab.

Any help here will be much appreciated sir. Thanks

 

 
  [ # 25 ]
Dave Morton - Apr 5, 2017:

Kavipria, the reason why that link is not available is because our beloved forum software has a problem with parsing the URL for that link, and removes an exclamation point from it. If you look at what the URL in Ravi’s post, then look at the actual URL it’s pointing to, you can see the problem. There was a similar problem on page 1 of this thread that I had the time to swap out for a bitly link. I don’t have time to do so this time, but the fix is simple. Just open the link in a new tab, then insert an exclamation point between the first and second characters (a lowercase ‘s’ and an uppercase ‘A’) after the last slash and the edited URL should work for you.

[ul]
[li]Please i really need your help sir, doesnt program AB have an inbuilt aiml to csv converter? if it does sir, how can i use it?[/li][/ul]

You see the problem i have is that, i dont have aimlif files on my copy of program-ab from github. so whenever i try to run the program it throws exceptions that it cant find the aimlif files so the program simply loads all the aiml files everytime.

Also, i used this project https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwi5heHW_ZXVAhUJkRQKHdS4AOkQFggoMAA&url=https://github.com/mpegman/Py3kAiml&usg=AFQjCNHFNFfcZdXNoi82QENg6rpOGaTHCw

and in the program, when the bot loads all its aiml for first use, it saves it in a really nice binary format inside a file. so next time i run the program, the startup time reduces by over 60%! i don’t know if program ab has this kinda functionality. I happen to know java quite well, but i know very little about program-ab.

Any help here will be much appreciated sir. Thanks

 

 
  [ # 26 ]
Richard Wallace - Feb 26, 2017:

AIMLIF (AIML Intermediate Format) is a hybrid of CSV and XML. It is what I developed for fast loading and editing of AIML files for Program AB, and also for making the files more compact for mobile apps.

Especially nowadays with the widespread adoption of competing formats like YAML and JSON, people complain about the reliance of AIML on the somewhat antiquated XML format.  The biggest problem with XML for AIML is the repetitive nature of the <category>, <pattern>, <template> (and<topic> and <that>) tags, which tend to take up a lot of space in the files and make them hard to read. 

But inside the <template>, we actually want the recursive, hierarchical structure provided by XML.  It is what allows the template to become a “mini computer program” to calculate the bot response. Compared with JSON or YAML, it is more readable and less error-prone because you don’t need double-quote around every string.  This property of XML, that every statement is an implicit print statement—no quote marks required—always appealed to me.

You can use tools like Excel to edit the AIMLIF files, sort the categories by pattern, and fill in the blank templates for faster content creation. 

Since AIMLIF is basically the same as AIML without the <category>, <pattern>, <template>, <topic> and <that>, it’s not a heavy lift to automatically translate back and forth to pure AIML.

Sir, i have a problem with program-ab, the problem i have is that, i dont have aimlif files on my copy of program-ab from github. so whenever i try to run the program it throws exceptions that it cant find the aimlif files so the program simply loads all the aiml files everytime.

Also, i used this project https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwi5heHW_ZXVAhUJkRQKHdS4AOkQFggoMAA&url=https://github.com/mpegman/Py3kAiml&usg=AFQjCNHFNFfcZdXNoi82QENg6rpOGaTHCw

and in the program, when the bot loads all its aiml for first use, it saves it in a really nice binary format inside a file. so next time i run the program, the startup time reduces by over 60%! i don’t know if program ab has this kinda functionality. I happen to know java quite well, but i know very little about program-ab.

Any help here will be much appreciated sir. Thanks

 

 
  [ # 27 ]
Ravi Kumar - Feb 27, 2017:

It is really easy to convert aiml and csv back and forth but not many people have tried to do it and feel that writing the same thing twice is a time consuming and boring. That’s why I tried making this parser so that people can increase their development speed.

Hi all, I was wondering if it could take a file from AIML 1.0.1 to CSV then change it to AIML 2.0 than the new file can be edited, after edit is done a new CSV file can be made from the AIML 2.0 final code

Can it be done?

 

 
  [ # 28 ]

AIML 1 is already compatible with AIML 2.

 

 
  [ # 29 ]
Steve Worswick - Sep 23, 2017:

AIML 1 is already compatible with AIML 2.

I thought aiml:javascript and Gossip was removed from Aiml 2.0 would this not make some problems?

 

 
  [ # 30 ]

Those tags were, indeed, removed from the AIML 2.0 specification, but that shouldn’t pose any problems. Whatever solution you use to perform the conversion should easily be able to detect the presence of those tags and present options for dealing with them, or simply remove them altogether.

 

 < 1 2 3 > 
2 of 3
 
  login or register to react
‹‹ AIML Question      S-AIML ››